Columnstores and Sparse Columns Flashcards

1
Q

What are columnstore indexes used for?

A

Storing and querying large data warehousing fact tables (Large amounts of data that don’t change)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a column store?

A

It’s data that is logically organized in columns and rows but physically stored in a column-wise data format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a rowgroup?

A

A group of rows that are compressed into columnstore format at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the maximum amount of rows in a rowgroup?

A

1,048,576 rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens to a rowgroup that has all data deleted?

A

It transitions from COMPRESSION to TOMBSTONE state and is later removed by a background process named the tuple-mover.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What happens with a columnstore that has many small rowgroups?

A

The columnstore index quality suffers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a column segment?

A

A column of data from within the rowgroup.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the rowgroup contain?

A

One column segment for every column on the table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the clustered columnstore index?

A

It is the physical storage for the entire table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Delta Rowgroup?

A

It is a clustered B-Tree index that stores rows until the number of rows reaches the threshold of a columnstore (1048576 rows) and then it is moved into the columnstore.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the benefits to using a columnstore?

A
  • It provides a high level of data compression, typically by 10x, to reduce data warehouse storage costs.
  • Performance is better for queries
  • Smaller in memory footprint
  • Batch execution by processing multiple rows together
  • Queries usually only select a few columns which reduces I/O
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Can you have a columnstore index on a rowstore table?

A

Yes, if you have 2016 or higher. You have to use a nonclustered columnstore and it takes more space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When do you use a nonclustered columnstore index?

A

To perform analysis in real time on an OLTP workload.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How many columns must be included for a nonclustered columnstore index on a Memory Optimized OLTP table?

A

All of them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When should you use sparse columns?

A

When the space saved is at least 20 percent to 40 percent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What type of indexes are sparse columns especially useful?

A

Filtered indexes because they can index only the rows that have values

17
Q

Can a sparse column have a default value?

A

No

18
Q

Can a computed column be a sparse column?

A

Yes it can be PART of a computed column, but a computed column cannot be marked as sparse.

19
Q

Can a table be compressed that contains a sparse column?

A

No, sparse columns are not compatible with compression.