11
DATA COMPRESSION IN SQL

Data Compression In SQL

Embed Size (px)

Citation preview

Page 1: Data Compression In SQL

DATA COMPRESSION IN SQL

Page 2: Data Compression In SQL

WHY DATA COMPRESSION………?• Compressing data reduces database storage, which leads to fewer I/O reads and writes

• it is important to understand the workload characteristics when deciding which tables to compress.

• Customer and Feedbacks.

Page 3: Data Compression In SQL

TWO LEVELS OF DATA COMPRESSION

Page 4: Data Compression In SQL

LET’S COMPRESS USING ROW COMPRESSION

• The metadata overhead of the record is reduced.

• All numeric (for example integer, decimal, and float) and numeric-based (for example datetime and money) data type values are converted into variable length values.

• the values stored like (integer - 4 bytes),(date time - 8 bytes), but after compression all unconsumed space is reclaimed.

• If a value 100 is stored in an integer-type column. We know an integer value between 0 and 255 can be stored in 1 byte. However, it reserves 4 bytes (integer type takes 4 bytes) on disk. Here, after compression, 3 bytes are reclaimed.

Page 5: Data Compression In SQL

LET’S COMPRESS USING PAGE COMPRESSION

• Row Compression As Discussed

• prefix compression

• Dictionary compression

Page 6: Data Compression In SQL

PREFIX COMPRESSION • Detect the Common pattern. • Store into Anchor Record and Refer from it.

Page 7: Data Compression In SQL

DICTIONARY COMPRESSION• Detect the common pattern• Create a dictionary based on the pattern and Replace the Values using

the pattern.

Page 8: Data Compression In SQL
Page 9: Data Compression In SQL

DISADVANTAGES USING COMPRESSION• Only certain data types will compress

• If you have CPU issues compressing database objects may intensify those issues

Page 10: Data Compression In SQL
Page 11: Data Compression In SQL

THANK YOU…………………….