11
Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Embed Size (px)

Citation preview

Page 1: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Dual Partitioning for improved performance in VLDBs

Ashwin Rao Karavadi, Rakesh ParidaMicrosoft IT

Page 2: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Data PartitioningWhy?

• Split a table into manageable partitions

• Improve data access performance

• Simplify maintenance

Page 3: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Partitioned Views

• Available since SQL Server 7.0• A partitioned view is a view defined by a UNION ALL of member tables structured in the same

way, but stored separately as multiple tables in either the same instance of SQL Server or in a

group of autonomous instances of SQL Server servers

• Query optimizer utilizes constraints to perform

partition elimination• Partition elimination occurs for SELECT and for DML statements

• Only one column can be used for partitioning• With only one constraint on the partitioning column

Page 4: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Partitioned Tables

• Available SQL Server 2005 onwards• Data is partitioned horizontally so that groups of rows are mapped into

individual partitions, based on a specified column. The partitions can be put

on one or more filegroups in the database. The table or index is treated as a

single logical entity when queries or updates are performed on the data

• Static and dynamic partition elimination

• Only one partition column can be used for

partitioning

Page 5: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Dual partitioning using partitioned views and partitioned tables

• Partition data using partitioned views over

partitioned tables

• Why dual partitioning:

– Support for scenarios where there is a need to

partition on two columns

– Optimized access when filtering on both columns

– Can spread data across multiple DBs/servers

Page 6: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Dual partitioning – application specific scenario

• Very large table with data related to FiscalYear and

FiscalMonth

• Need to archive data into a different database based on

FiscalYear

• Optimized data access for queries based on FiscalYear and

FiscalMonth

• Simplified data loading from source and data extraction to

archive

Page 7: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Dual partitioning – sample execution plans

Page 8: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Dual partitioning – sample execution plans

Page 9: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Partition-aligned indexed views

• Available SQL Server 2008 onwards

• Can create indexed views over the data in

partitioned tables to improve query performance– In order for a view to be indexed and automatically maintained during partition

switching, the base table and the view must share equivalent partitioning schemes.

That means that if the base table and the view use different partition schemes, the

two partition schemes must be based on the same, or equivalent, partition functions

• Can be (judiciously) used to improve performance

Page 10: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

Partition-aligned indexed views – sample execution plans

Page 11: Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market

conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.