简体   繁体   English

SQL Server2012中的表分区不完整

[英]Table Partitioning incomplete in sql server2012

I have a large table which contains 83 million records in it. 我有一张大桌子,上面有8300万条记录。
There is a column called 'TradingDateKey' based on which the table is partitioned. 有一个称为“ TradingDateKey”的列,表将基于该列进行分区。

Below are the partition schema and partition functions : 以下是分区模式和分区功能:

CREATE PARTITION SCHEME [ps__fac_sale] AS PARTITION [pf__fac_sale] TO 创建分区计划[ps__fac_sale]作为分区[pf__fac_sale]到
([fg__fac_sale__2005], [fg__fac_sale__2006], [fg__fac_sale__2007], ([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__2008],[fg__fac_sale__2009],[fg__fac_sale__2010],
[fg__fac_sale__2011], [fg__fac_sale__2012], [fg__fac_sale__2013], [fg__fac_sale__2011],[fg__fac_sale__2012],[fg__fac_sale__2013],
[fg__fac_sale__2014]) [fg__fac_sale__2014])
GO

CREATE PARTITION FUNCTION pf__fac_sale AS RANGE LEFT FOR VALUES 创建分区函数pf__fac_sale作为值的左移范围
(20050630, 20060630, 20070630, 20080630, 20090630, 20100630, 20110630, (20050630、20060630、20070630、20080630、20090630、20100630、20110630,
20120630, 20130630) 20120630、20130630)
GO

As you can see there are no partitions after 20130630 to 20150915. 如您所见,20130630至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 上面的表whihc也使用了一些连接,
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. 在Microsoft网站上查看alter partition functionalter partition scheme语法。 The basic syntax is: 基本语法为:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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