2 extreme performance - smaller is better

  • 656 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
656
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
8
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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