Upload
boosh-booshan
View
116
Download
0
Embed Size (px)
Citation preview
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.
TWO LEVELS OF DATA COMPRESSION
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.
LET’S COMPRESS USING PAGE COMPRESSION
• Row Compression As Discussed
• prefix compression
• Dictionary compression
PREFIX COMPRESSION • Detect the Common pattern. • Store into Anchor Record and Refer from it.
DICTIONARY COMPRESSION• Detect the common pattern• Create a dictionary based on the pattern and Replace the Values using
the pattern.
DISADVANTAGES USING COMPRESSION• Only certain data types will compress
• If you have CPU issues compressing database objects may intensify those issues
THANK YOU…………………….