简体   繁体   中英

Table Partitioning incomplete in sql server2012

I have a large table which contains 83 million records in it.
There is a column called 'TradingDateKey' based on which the table is partitioned.

Below are the partition schema and partition functions :

CREATE PARTITION SCHEME [ps__fac_sale] AS PARTITION [pf__fac_sale] TO
([fg__fac_sale__2005], [fg__fac_sale__2006], [fg__fac_sale__2007],
[fg__fac_sale__2008], [fg__fac_sale__2009], [fg__fac_sale__2010],
[fg__fac_sale__2011], [fg__fac_sale__2012], [fg__fac_sale__2013],
[fg__fac_sale__2014])
GO

CREATE PARTITION FUNCTION pf__fac_sale AS RANGE LEFT FOR VALUES
(20050630, 20060630, 20070630, 20080630, 20090630, 20100630, 20110630,
20120630, 20130630)
GO

As you can see there are no partitions after 20130630 to 20150915.
The problem is that We have a query given by our client to run against the
above table whihc also uses some joins and it
is taking long time to execute .

can you please let me know the best possible way to fix this. Can we alter the
partition function and schema and rebuild indexes or it has to be complete
reload of data into another table with proper partition function & schema?
.

Your help is appreciated
.Thank you

You can adjust the partition function and scheme without rebuilding the table. Check out alter partition function and alter partition scheme syntax over at Microsoft's website. The basic syntax is:

alter partition function pf__fac_sale() split range (newrangevalue);
go
alter partition scheme ps__fac_sale next used [filegroup]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM