2   extreme performance - smaller is better
Upcoming SlideShare
Loading in...5
×
 

2 extreme performance - smaller is better

on

  • 921 views

 

Statistics

Views

Total Views
921
Views on SlideShare
790
Embed Views
131

Actions

Likes
0
Downloads
7
Comments
0

2 Embeds 131

http://www.sqlserver.co.il 130
http://www.google.co.il 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

2   extreme performance - smaller is better 2 extreme performance - smaller is better Presentation Transcript

  • Smaller is Better
    ישי גרין| ראש צוות DBA| הבורסה לניירות ערך
  • Data Compression – Why bother?
    Physical Compression Methods
    Logical Compression Methods
  • 3
  • 4
  • 5
  • 6
  • Data Compression – Whybother?
    The bigger the data – the bigger the challenges
  • Data Compression – Whybother?
    Every action takes longer
    • Data Access Queries
    • Loading data volumes
    • Archiving
    • Maintenance (backups, fragmentation, statistics, data replications…)
    • Storage constraints
  • Physical Compression Methods
    Archiving
    Data compression (SQL 2008)
    Smaller data types
    Horizontal Partitioning
    Vertical Partitioning
  • Archiving
    The most efficient way to minimize data in OLTP
    • 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.
  • Data compression (SQL 2008)
    Compression Type
    Data Compression
    • Table level
    • Index level
    Backup Compression
    Compression Methods
    Row Compression
    Page Compression
  • 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.
  • Data compression (SQL 2008)
    Row Compression
    13
  • 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.
    • Dictionary compression looks for exact value matches across all columns and rows on each page.
    14
    14
  • Data compression (SQL 2008)
    PAGE Compression
      Prefix Compression
      Dictionary Compression
    15
  • Data compression (SQL 2008)
    Performance
    16
  • Data compression (SQL 2008)
    Performance
    17
  • Data compression (SQL 2008)
    Performance - Summary
    CPU IO
    • Better performance when IO is a bottleneck
    • Reduces storage needs significantly
    • Use advisory procedure to calculate compression
  • Using Smallest Data Type Available
    19
  • Using Smallest Data Type Available
    Examples:
    • Char (large fixed value)  Varchar (large value)
    • UniCode data type  NonUnicode
    • Datetime  SmallDateTime
    • Datetime  Date
    • Datetime  Time
    20
  • Partitioning
    Definition:
    Breakup a table or index into smaller parts, that when stitched recreate the original object.
    Types of Partitioning:
    Horizontal
    Vertical
    21
  • Horizontal Partitioning
    • Each table maintains a similar schema, but contains fewer rows.
    • There is no data overlap between the partitions.
    • A logical union of partitions recreates the original logical table.
    22
  • Horizontal Partitioning
  • Horizontal Partitioning
    Slow storage
    Medium speed storage
    Fast storage
    24
  • Horizontal Partitioning
    3 Types of implementing Horizontal Partitions
    • Partitioned Views
    • Partitioned Indexes
    • Partitioned Tables
  • Horizontal Partitioning - until SQL 2005
    Partitioned view
    • You can have differences between the tables the partitioned view references
    • The optimizer must consider each partition separately and duplicate the query's filter against the view for all partitions in the plan
    • Limits on update or delete operations
    26
  • Native Horizontal PartitioningSQL 2005 and on
    One Object!!!
    • One table
    • One index
    • One PartitionFunction
    • One Partition Scheme
  • Vertical Partitioning
    • Divide a logical table into multiple physical tables that contain fewer columns, but the same number of rows.
    • To Recreate the original table, join the partitioned tables on the primary key columns.
  • Vertical Partitioning
  • Partitioning - Summary
    • use Vertical Partitioning when some columns are more queried than others(columns is the Select list)
    • Use Horizontal Partitioning when part of the data is queried more than others(columns is the Where clause)
  • DEMO
    Logical Compression Methods
    31
    31
  • Logical Compression
    Methods
    Covering Indexes
    Filtered Indexes
    Sparse Columns
    Refactoring TSQL to retrieve less data
  • When it comes to data
    Smaller is Better !!
    33