SQL Server Statistics

What statistics are for?

Query processing phases

  • Bullet One
  • Bullet Two
  • good enough execution plan

Cardinality estimation

  • number of rows that need to be processed on each step of the query execution
  • important factor in query optimization
  • affects:
    • choice of join strategies
    • memory grants

What statistics are?

  • system object
  • contain the information about data distribution:
    • in columns which comprise indices' keys
    • sometimes in regular column values
  • column data type has to support comparison operators

DBCC SHOW_STATISTICS

  • returns three result sets
    1. general metadata information
    2. density
    3. histogram
  • Bullet Two
  • Bullet Three

deck

By rav

deck

  • 213