Relation between Table Partition and Cluster Index

  • Hi!

    I have a table SO_Orders and need to reduce Read I/O from this table. So I have decide table partitioning on multiple disks (Multiple file groups).

    My question is that what will happen when I create cluster index on my partitioned table. How Leaf level pages will be arrange on disk. Or may I create partition on clustered index?

    What is the best way table partitioning or index partitioning or both?

    Ramdas Singh

    MCDBA

    Ram
    MSSQL DBA

  • for short ,when you create a table you need to select the partition scheme and file groups.In partiton scheme you will mention partition function .

    Now the clustered index has the data as well so it will automatically be partitioned as per the partitons you mentioned for the table.

    for non-clustered index you can again mention the filegroup and the partiton scheme .

    this way you will reduce the IOs as the complete data will not be accessed but only the partition where that data you are requesting resides.

    Regards

    Abhay Chaudhary
    Sr.DBA (MCITP/MCTS :SQL Server 2005/2008 ,OCP 9i)

  • Hi Abhay,

    as you said we need to mentioned the partition schema while declaring the table as shown below :-

    CREATE TABLE [dbo].[fact_warehouse_transaction]( [transaction_ident] [int] NOT NULL IDENTITY(1, 1), [natural_key] [decimal](18, 0) NULL, [dimension1_ident] [int] NULL, [dimension2_ident] [int] NULL, --… (many other columns) [transaction_date_and_time] [datetime] NOT NULL ) ON [Transaction_Warehouse_Partition_Scheme] (transaction_date_and_time)

    BUT, my problem is that , I already have this table (Suppose 'fact_warehouse_transaction' )in DB with primary key over column 'transaction_date_and_time' ,with millions of records.

    So i can't run create script instead i need to create Alter Table sort of script.

    Can you please suggest the syntax of alter to add this schema 'Transaction_Warehouse_Partition_Scheme' in it.

    OR is it so , that when i Re-create Clustered index of this table by binding it to the PARTITIONED SCHEMA , table will automatically be divided in to the different partition ?

    ex :-

    CREATE Clustered INDEX ix_transaction_warehouse_partitioned

    ON [dbo].[fact_warehouse_transaction] (transaction_date_and_time)

    ON Transaction_Warehouse_Partition_Scheme (transaction_date_and_time)

    IN short is 'partitioning Clustered index' and pratition table the same thing ?

    Please clearify.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply