0
Smaller is Better<br />ישי גרין| ראש צוות DBA| הבורסה לניירות ערך<br />
Data Compression – Why bother?<br />Physical Compression Methods<br />Logical Compression Methods<br />
3<br />
4<br />
5<br />
6<br />
Data Compression – Whybother?<br />The bigger the data – the bigger the challenges<br />
Data Compression – Whybother?<br />Every action takes longer<br /><ul><li>Data Access Queries
Loading data volumes
Archiving
Maintenance (backups, fragmentation, 				     statistics, data replications…)
Storage constraints</li></li></ul><li>Physical Compression Methods<br />Archiving<br />Data compression (SQL 2008)<br />Sm...
Archiving<br />  The most efficient way to minimize data in OLTP<br /><ul><li>Good: Archive data into a Archive Repository
Better: Archive data to flat files or other media 		(BCP out)
Best: Purge data. Retrieve data from backup 		ifneeded.</li></li></ul><li>Data compression (SQL 2008)<br />Compression Typ...
Index level</li></ul>Backup Compression<br />Compression Methods<br />Row Compression<br />Page Compression <br />
Data compression (SQL 2008)<br />Row Compression<br />Storing fixed-length data types in variable-length storage format. <...
Data compression (SQL 2008)<br />Row Compression<br />13<br />
Data compression (SQL 2008)<br />PAGE Compression<br />a superset of row compression. <br />    optimizes storage of multi...
Dictionary compression looks for exact value matches across all columns and rows on each page. </li></ul>14<br />14<br />
Data compression (SQL 2008)<br />PAGE Compression<br />  Prefix Compression<br />  Dictionary Compression<br />15<br />
Data compression (SQL 2008)<br />Performance<br />16<br />
Data compression (SQL 2008)<br />Performance<br />17<br />
Data compression (SQL 2008)<br />Performance - Summary<br />			CPU      IO<br /><ul><li>Better performance when IO is a bo...
Reduces storage needs significantly
Use advisory procedure to calculate compression</li></li></ul><li>Using Smallest Data Type Available<br />19<br />
Using Smallest Data Type Available<br />Examples:<br /><ul><li>Char (large fixed value)  Varchar (large value)
UniCode data type  NonUnicode
Datetime  SmallDateTime
Datetime  Date
Datetime  Time</li></ul>20<br />
Partitioning<br />Definition:<br />    Breakup a table or index into smaller parts, that when stitched recreate the origin...
Horizontal Partitioning<br /><ul><li>Each table maintains a similar schema, but  contains fewer rows.
There is no data overlap between the partitions.
Upcoming SlideShare
Loading in...5
×

2 extreme performance - smaller is better

713

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
713
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "2 extreme performance - smaller is better"

  1. 1. Smaller is Better<br />ישי גרין| ראש צוות DBA| הבורסה לניירות ערך<br />
  2. 2. Data Compression – Why bother?<br />Physical Compression Methods<br />Logical Compression Methods<br />
  3. 3. 3<br />
  4. 4. 4<br />
  5. 5. 5<br />
  6. 6. 6<br />
  7. 7. Data Compression – Whybother?<br />The bigger the data – the bigger the challenges<br />
  8. 8. Data Compression – Whybother?<br />Every action takes longer<br /><ul><li>Data Access Queries
  9. 9. Loading data volumes
  10. 10. Archiving
  11. 11. Maintenance (backups, fragmentation, statistics, data replications…)
  12. 12. Storage constraints</li></li></ul><li>Physical Compression Methods<br />Archiving<br />Data compression (SQL 2008)<br />Smaller data types<br />Horizontal Partitioning<br />Vertical Partitioning <br />
  13. 13. Archiving<br /> The most efficient way to minimize data in OLTP<br /><ul><li>Good: Archive data into a Archive Repository
  14. 14. Better: Archive data to flat files or other media (BCP out)
  15. 15. Best: Purge data. Retrieve data from backup ifneeded.</li></li></ul><li>Data compression (SQL 2008)<br />Compression Type<br />Data Compression<br /><ul><li>Table level
  16. 16. Index level</li></ul>Backup Compression<br />Compression Methods<br />Row Compression<br />Page Compression <br />
  17. 17. Data compression (SQL 2008)<br />Row Compression<br />Storing fixed-length data types in variable-length storage format. <br /> A compressed row uses 4 bits per compressed column to store the length of the data in the column. <br />
  18. 18. Data compression (SQL 2008)<br />Row Compression<br />13<br />
  19. 19. Data compression (SQL 2008)<br />PAGE Compression<br />a superset of row compression. <br /> optimizes storage of multiple rows in a page, by minimizing the data redundancy. Page compression uses prefix compression and dictionary compression. <br /><ul><li>Prefix compression looks for common patterns in the beginning of the column values on a given column across all rows on each page.
  20. 20. Dictionary compression looks for exact value matches across all columns and rows on each page. </li></ul>14<br />14<br />
  21. 21. Data compression (SQL 2008)<br />PAGE Compression<br />  Prefix Compression<br />  Dictionary Compression<br />15<br />
  22. 22. Data compression (SQL 2008)<br />Performance<br />16<br />
  23. 23. Data compression (SQL 2008)<br />Performance<br />17<br />
  24. 24. Data compression (SQL 2008)<br />Performance - Summary<br /> CPU IO<br /><ul><li>Better performance when IO is a bottleneck
  25. 25. Reduces storage needs significantly
  26. 26. Use advisory procedure to calculate compression</li></li></ul><li>Using Smallest Data Type Available<br />19<br />
  27. 27. Using Smallest Data Type Available<br />Examples:<br /><ul><li>Char (large fixed value)  Varchar (large value)
  28. 28. UniCode data type  NonUnicode
  29. 29. Datetime  SmallDateTime
  30. 30. Datetime  Date
  31. 31. Datetime  Time</li></ul>20<br />
  32. 32. Partitioning<br />Definition:<br /> Breakup a table or index into smaller parts, that when stitched recreate the original object.<br />Types of Partitioning:<br />Horizontal<br />Vertical<br />21<br />
  33. 33. Horizontal Partitioning<br /><ul><li>Each table maintains a similar schema, but contains fewer rows.
  34. 34. There is no data overlap between the partitions.
  35. 35. A logical union of partitions recreates the original logical table.</li></ul>22<br />
  36. 36. Horizontal Partitioning<br />
  37. 37. Horizontal Partitioning<br />Slow storage<br />Medium speed storage<br />Fast storage<br />24<br />
  38. 38. Horizontal Partitioning<br /> 3 Types of implementing Horizontal Partitions<br /><ul><li> Partitioned Views
  39. 39. Partitioned Indexes
  40. 40. Partitioned Tables</li></li></ul><li>Horizontal Partitioning - until SQL 2005<br />Partitioned view<br /><ul><li>You can have differences between the tables the partitioned view references
  41. 41. The optimizer must consider each partition separately and duplicate the query's filter against the view for all partitions in the plan
  42. 42. Limits on update or delete operations </li></ul>26<br />
  43. 43. Native Horizontal PartitioningSQL 2005 and on<br />One Object!!!<br /><ul><li>One table
  44. 44. One index
  45. 45. One PartitionFunction
  46. 46. One Partition Scheme</li></li></ul><li>Vertical Partitioning<br /><ul><li>Divide a logical table into multiple physical tables that contain fewer columns, but the same number of rows.
  47. 47. To Recreate the original table, join the partitioned tables on the primary key columns.</li></li></ul><li>Vertical Partitioning<br />
  48. 48. Partitioning - Summary<br /><ul><li>use Vertical Partitioning when some columns are more queried than others(columns is the Select list)
  49. 49. Use Horizontal Partitioning when part of the data is queried more than others(columns is the Where clause)</li></li></ul><li>DEMO<br />Logical Compression Methods<br />31<br />31<br />
  50. 50. Logical Compression<br />Methods<br />Covering Indexes<br />Filtered Indexes<br />Sparse Columns <br />Refactoring TSQL to retrieve less data<br />
  51. 51. When it comes to data<br />Smaller is Better !!<br />33<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×