1 © Copyright 2009 EMC Corporation. All rights reserved. Data Warehousing Features in SQL Server 2008 James

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

Tuning Oracle SQL The Basics of Efficient SQLThe Basics of Efficient SQL Common Sense Indexing The Optimizer –Making SQL Efficient Finding Problem Queries.
Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008.
Data Management and Index Options for SQL Server Data Warehouses Atlanta MDF.
1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Big Data Working with Terabytes in SQL Server Andrew Novick
Dos and don’ts of Columnstore indexes The basis of xVelocity in-memory technology What’s it all about The compression methods (RLE / Dictionary encoding)
IBM Software Group ® Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
8-1 Outline  Overview of Physical Database Design  File Structures  Query Optimization  Index Selection  Additional Choices in Physical Database Design.
Jeremy Boyd Director – Mindscape MSDN Regional Director
Making Data Warehouse Easy Conor Cunningham – Principal Architect Thomas Kejser – Principal PM.
Architecting a Large-Scale Data Warehouse with SQL Server 2005 Mark Morton Senior Technical Consultant IT Training Solutions DAT313.
Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT.
SQL Server Query Optimizer Cost Formulas Joe Chang
SQL Server 2005 SP2 Israeli SQL Server User Group March 2005 Ami Levin
1DBTest2008. Motivation Background Relational Data Warehousing (DW) SQL Server 2008 Starjoin improvement Testing Challenge Extending Enterprise-class.
Parallel Execution Plans Joe Chang
Performance and Scalability. Performance and Scalability Challenges Optimizing PerformanceScaling UpScaling Out.
Lecture 8 Index Organized Tables Clusters Index compression
ISV Innovation Presented by ISV Innovation Presented by Business Intelligence Fundamentals: Data Loading Ola Ekdahl IT Mentors 9/12/08.
CS 345: Topics in Data Warehousing Tuesday, October 19, 2004.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
SQL Server Indexes Indexes. Overview Indexes are used to help speed search results in a database. A careful use of indexes can greatly improve search.
Integration Services in SQL Server 2008 Allan Mitchell SQL Server MVP.
Parallel Execution Plans Joe Chang
Parallel Execution Plans Joe Chang
Data Warehousing Enhancements Dr Keith Burns Data Architect DPE, Microsoft Ltd.
1 Chapter 10 Joins and Subqueries. 2 Joins & Subqueries Joins – Methods to combine data from multiple tables – Optimizer information can be limited based.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Introduction to Query Optimization Chapter 13.
SQLintersection Putting the "Squeeze" on Large Tables Improve Performance and Save Space with Data Compression Justin Randall Tuesday,
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
INTRODUCING SQL SERVER 2012 COLUMNSTORE INDEXES Exploring and Managing SQL Server 2012 Database Engine Improvements.
2012 © Trivadis BASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN Welcome November 2012 Columnstore Indexes.
Your Data Any Place, Any Time Performance and Scalability.
Sorting and Joining.
Introduction to Database Systems1 External Sorting Query Processing: Topic 0.
Best Practices in Loading Large Datasets Asanka Padmakumara (BSc,MCTS) SQL Server Sri Lanka User Group Meeting Oct 2013.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
Execution Plans Detail From Zero to Hero İsmail Adar.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
Doing fast! Optimizing Query performance with ColumnStore Indexes in SQL Server 2012 Margarita Naumova | SQL Master Academy.
Tuning Oracle SQL The Basics of Efficient SQL Common Sense Indexing
Data Warehouse ETL By Garrett EDmondson Thanks to our Gold Sponsors:
SQL Server Statistics and its relationship with Query Optimizer
Temporal Databases Microsoft SQL Server 2016
Finding more space for your tight environment
Applying Data Warehouse Techniques
Introduction to Query Optimization
Blazing-Fast Performance:
Physical Join Operators
Physical Database Design
MPP – Maximize Parallel Productivity
20 Questions with Azure SQL Data Warehouse
SQL Server 2016 Execution Plan Analysis Liviu Ieran
Azure SQL DWH: Optimization
Table Partitioning Intro and make that a sliding window too!
Sunil Agarwal | Principal Program Manager
Table Partitioning Intro and make that a sliding window too!
Clustered Columnstore Indexes (SQL Server 2014)
Implementation of Relational Operations
Table Partitioning Intro and make that a sliding window too!
Bulk Load and Minimal Logging
Diving into Query Execution Plans
Applying Data Warehouse Techniques
A – Pre Join Indexes.
Presentation transcript:

1 © Copyright 2009 EMC Corporation. All rights reserved. Data Warehousing Features in SQL Server 2008 James

2 © Copyright 2009 EMC Corporation. All rights reserved. Official DW Feature Set in SQL 2008 BuildManageDeliver Insight SQL Server RDBMS MERGE statement Change data capture (CDC) Minimally logged INSERT Backup compression Star join performance Faster parallel query on partitioned tables GROUPING SETS Resource governor Data compression Partition-aligned indexed views Integration Services Lookup performance Pipeline performance Analysis Services Backup MDX Query Performance: Block Computation Query & Write-back Performance Scalable Shared Database Reporting Services Reporting scalability Server scalability

3 © Copyright 2009 EMC Corporation. All rights reserved. JRJ’s DW Feature Set in SQL 2008 BuildManageDeliver Insight SQL Server RDBMS MERGE statement Change data capture (CDC) Minimally logged INSERT & TF 610 NEW Data Types Backup compression Star join performance Faster parallel query on partitioned tables Few Outer Rows Parallelism GROUPING SETS ISOWEEK IN DATEPART Resource governor Data compression Partition-aligned indexed views Partition index rebuilds Filtered Indexes Integration Services Lookup performance Pipeline performance Data Profiling Task Analysis Services Backup MDX Query Performance: Block Computation Query & Writeback Performance Scalable Shared Database Reporting Services Reporting scalability Server scalability

4 © Copyright 2009 EMC Corporation. All rights reserved. What We’ll Focus On BuildManageDeliver Insight SQL Server RDBMS MERGE statement Change data capture (CDC) Minimally logged INSERT & TF 610 NEW Data Types Backup compression Star join performance Faster parallel query on partitioned tables Few Outer Rows Parallelism GROUPING SETS ISOWEEK IN DATEPART Resource governor Data compression Partition-aligned indexed views Partition index rebuilds Filtered Indexes Integration Services Lookup performance Pipeline performance Data Profiling Task Analysis Services Backup MDX Query Performance: Block Computation Query & Writeback Performance Scalable Shared Database Reporting Services Reporting scalability Server scalability

5 © Copyright 2009 EMC Corporation. All rights reserved. Data Compression  Enterprise Edition Only  Row and Page Compression  Compression Ratio 2 to 1 or 3 to % to 70% reduction in data  Can be for a table, index or a subset of their partitions  Estimate savings: exec sp_estimate_data_compression_savings  Max row size plus compression overhead must not exceed 8060 bytes

6 © Copyright 2009 EMC Corporation. All rights reserved. Compression Alert

7 © Copyright 2009 EMC Corporation. All rights reserved. Monitoring Compression  SQL Server, Access Methods Object  Page compression attempts/sec  Pages compressed/sec  Compression Statistics for individual Partitions  Dynamic Management Function  sys.dm_db_index_operational_stats

8 © Copyright 2009 EMC Corporation. All rights reserved. DEMO TIME Resource Governor (Quickly) Data Compression

9 © Copyright 2009 EMC Corporation. All rights reserved. P & P PartitioningParallelism

10 © Copyright 2009 EMC Corporation. All rights reserved. Partitioning & Parallelism  Partition Table Parallelism  Few Outer Rows Parallelism  Partition-Aligned Indexed Views  SQL 2005 behaviour – needs to be dropped before switch  Switch Partition Pulls across indexed view  Rebuild index partition

11 © Copyright 2009 EMC Corporation. All rights reserved. What is a Partitioned Table? P1P4P3P2 SELECT SUM(Sales_Qty) as Sales_Qty, SUM(Sale_Amt) as Sales_Amount FROM SalesDB.dbo.Tbl_Fact_Sales WHERE date_id between ' ' and ' '

12 © Copyright 2009 EMC Corporation. All rights reserved. The “Problem” in SQL 2005 RowsExecutesStmtText 11 SELECT SUM([Sales_Qty]) [Sales_Qty],SUM([Sale_Amt]) [Sales_Amount] FROM [SalesDB].[dbo].[Tbl_Fact_Sales] WHERE AND 00 |--Compute Scalar(DEFINE:([Expr1002]=CASE WHEN [globalagg1008]=(0) THEN NULL ELSE [globalagg1010] END, [Expr1003]=CASE WHEN [globalagg1012]=(0) THEN NULL ELSE [globalagg1014] END)) 11 |--Stream Aggregate(DEFINE:([globalagg1008]=SUM([partialagg1007]), [globalagg1010]=SUM([partialagg1009]), [globalagg1012]=SUM([partialagg1011]), [globalagg1014]=SUM([partialagg1013]))) 21 |--Parallelism(Gather Streams) 212 |--Stream Aggregate(DEFINE:([partialagg1007]=COUNT_BIG([SalesDB].[dbo].[Tbl_Fact_Sales].[Sales_Qty] as [ss].[Sales_Qty]), [partialagg1009]=SUM([SalesDB].[dbo].[Tbl_Fact_Sales].[Sales_Qty] as [ss].[Sales_Qty]), [partialagg1011]=COUNT_BIG([SalesDB].[dbo].[Tbl_Fact_Sales].[Sale_Amt] as [ss].[Sale_Amt]), [partialagg1013]=SUM([SalesDB].[dbo].[Tbl_Fact_Sales].[Sale_Amt] as [ss].[Sale_Amt]))) |--Nested Loops(Inner Join, OUTER REFERENCES:([PtnIds1006]) PARTITION ID:([PtnIds1006])) 212 |--Parallelism(Distribute Streams, Demand Partitioning) 21 | |--Constant Scan(VALUES:(((80)),((81)))) |--Index Seek(OBJECT:([SalesDB].[dbo].[Tbl_Fact_Sales].[IX_Tbl_Fact_Sales_SKDteItmStrIDSalQtySalAmtDiscMkd] AS [ss]), SEEK:([ss].[SK_Date_ID] >= ( ) AND [ss].[SK_Date_ID] <= ( )) ORDERED FORWARD PARTITION ID:([PtnIds1006]))

13 © Copyright 2009 EMC Corporation. All rights reserved. Partitioning & Parallelism Compared P1P4P3P2 P2P2 P1P4P3P2 P2P2 SQL Server 2005 SQL Server 2008

14 © Copyright 2009 EMC Corporation. All rights reserved. Work Around for SQL Server 2005  UNION SELECT SUM(Sales_Qty) as Sales_Qty, SUM(Sale_Amt) as Sales_Amount FROM SalesDB.dbo.Tbl_Fact_Sales WHERE date_id between ' ' and ' ' SELECT SUM(Sales_Qty) as Sales_Qty, SUM(Sale_Amt) as Sales_Amount FROM SalesDB.dbo.Tbl_Fact_Sales WHERE date_id between ' ' and ' '

15 © Copyright 2009 EMC Corporation. All rights reserved. Few Outer Rows Parallelism  SQL 2005  One thread given per page of rows on a nested loop join  SQL 2008  One thread given per row on a nested loop join  Good for Joins to Date Dim  M$ internal DW Scale Benchmark perf increase by 30% SELECTd.Date_Desc,SUM(f.Sale_Amt*f.Sales_Qty) FROM Tbl_Fact_Store_Sales f JOIN Tbl_Dim_Date d ONf.sk_date_id = d.sk_date_id WHERE d.date_value between '10/1/2004' and '10/7/2004' GROUP BYd.Date_Desc

16 © Copyright 2009 EMC Corporation. All rights reserved. Work-Around’s for SQL Server 2005  STUFF YOUR ROW  Add a JUNK Col on the Date dimension to force one row per page  CLUSTER ON A GUID  Add a column and populate with GUIDs to encourage Rows onto separate pages

17 © Copyright 2009 EMC Corporation. All rights reserved. Partition Aligned Indexed Views  The Big Chore was “Sliding” a table with an indexed view on it.  In 2005 this needed to be dropped  In 2008 it does not

18 © Copyright 2009 EMC Corporation. All rights reserved. IT’S DEMO TIME Sliding Window with Indexed View in Place Rebuild Partitioned Index Filtered Indexes

19 © Copyright 2009 EMC Corporation. All rights reserved. STAR JOINS “Optimized” Bitmap Filters  What is a Bitmap filter –In memory structure (no index overhead) –Created dynamically –Typically quite small in size  Bitmap Filter SQL 2005 –What it was in –Hash or Merge JOIN  Optimised Bitmap Filter SQL 2008 –Enterprise Edition –Parallel Query –Hash JOIN only –Fact table must have > 100 pages –Single Column join (No PK FK relationship requirement)(integer needed for optimized) –Dimension input cardinalities are smaller than fact input cardinalities –Look for Bitmap warning event for missed opportunities to use Bitmap

20 © Copyright 2009 EMC Corporation. All rights reserved. Minimally Logged Inserts & TF 610

21 © Copyright 2009 EMC Corporation. All rights reserved. Bulk Load Methods Compared

22 © Copyright 2009 EMC Corporation. All rights reserved. FOR THE FINAL TIME STAR JOINS Minimally Logged INSERTS