SQL Server分区表,能否按照多个列作为分区函数的分区依据(转载)

问:


Hi,

I have a table workcachedetail with 40 million rows which has 8 columns.We decided to partition the table.Most of the queries in our environment uses 4 columns in the where clause or joins.If I partition the table with 4 columns then I may get better performance.Can we partition the table on multiple columns(like partitioning on id,deptid,designation)?

Thanks,

 

 

答:


no

 

You can partition by creating a persisted computed columns.

https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-computed-column-definition-transact-sql

 

意思就是,目前SQL Server还不支持将多个列作为分区函数的分区依据,只能用一列作为分区函数的分区依据,但是我们可以将多个列构造为一个计算列(computed columns)来作为分区依据。

 

 

参考文献:

how to partition a table on multiple columns

 

转载于:https://www.cnblogs.com/OpenCoder/p/10987270.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值