如何在 SQL Server 中基于外键进行有效分区?
我正在使用 SQL Server,想要在表上创建分区。我想将其基于另一个表中的外键。
table1 (
fk uniqueidentifier,
data
)
fk 指向 table2
table 2 (
partition element here
)
我想根据 table2 的数据对 table1 进行分区,即如果 table2 包含类别
I am working on SQL Server and want to create a partition on a table. I want to base it off of a foreign key which is in another table.
table1 (
fk uniqueidentifier,
data
)
fk points to table2
table 2 (
partition element here
)
I want to partition table1 base on table2's data, ie if table2 contains categories
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
外键关系并不重要,水平分区基于表本身的值。外键只是确保它们已经存在于另一个表中。
链接:
The foreign key relationship doesn't really matter, horizontal partitioning is based on the values in the table itself. The foreign key just makes sure they already exist in another table.
Links: