SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Partitioned Table and Index Storage Confusion


Partitioned Table and Index Storage Confusion

Author
Message
smallmoney
smallmoney
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1126 Visits: 574
Hi,

I have a simple yet maybe complex question. I never created or worked with Partitioned Tables yet.

Lets pretend I have a table in Sales.SalesOrderDetails in AdventureWorks (I don't remember the exact table name) with a million records.

Next lets pretend there is a column name order_date and values ranging from 1/1/2012 to 1/19/2014.

In addition the table is partitioned based on the order_date into three filegroups, one per year.

This table is a heap and I decided to create an index idx_order_date on column order_date.

Where is this index stored? Is it stored across the three file groups?

Thanks!
GilaMonster
GilaMonster
SSC Guru
SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)

Group: General Forum Members
Points: 231242 Visits: 46350
Depends. If you create the index on the partition scheme, it will be partitioned like the table and stored across the three filegroups. If you create the index on a filegroup, it's not partitioned and is stored entirely in that filegroup.

Basically, it's stored where ever the ON clause of the create index specifies.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


smallmoney
smallmoney
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1126 Visits: 574
GilaMonster (1/19/2014)
Depends. If you create the index on the partition scheme, it will be partitioned like the table and stored across the three filegroups. If you create the index on a filegroup, it's not partitioned and is stored entirely in that filegroup.

Basically, it's stored where ever the ON clause of the create index specifies.


Thanks Gila.

If I don't specify an on clause, will it by default be stored on the primary filegroup?

IE:

CREATE NONCLUSTERED INDEX idx_orderdate SalesOrderDetail(order_date)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)

Group: General Forum Members
Points: 231242 Visits: 46350
It'll be on whatever filgroup is defined as the default one.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search