Compression Flashcards

1
Q

What are the negatives with compression?

A

Additional time is spent getting data, so you lose speed with compression.

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

What does Row Compression do for you?

A
  • Reduces metadata overhead
  • Uses variable-length storage for numeric-based types
  • Uses variable-length character strings
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Prefix Compression

A

Stores commonly-used prefixes elsewhere

Prefix values are replaced by a reference to the prefix

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

What is Dictionary compression?

A

Replaces commonly used values. (within a page)

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

What compression is included with Page Compression?

A

Row Compression
Prefix Compression
Dictionary Compression
(In order)

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

What is the t-sql to create compression on a table?

A

ALTER TABLE [TABLENAME] REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = PAGE)

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

What is the t-sql to get how much data would be saved with compression?

A

exec sp_estimate_data_compression_savings

‘schema’,’table’, indexid, null, ‘PAGE’

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

What is Sparse for a column?

A

It allows the database to save space with NULL values, but it will use more space with non nulls.
40-60% of values need to be null for this to be effective.

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

What is a columnstore?

A

It has a high level of data compression as well as greater speed.

rowstore works better for seeks
columnstore works better for scans (large tables - 200k+ rows)

Table can only have 1 nonclustered columnstore index

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