如何在 SQL Server 中基于外键进行有效分区?

发布于 2024-08-23 11:14:54 字数 258 浏览 8 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独难免 2024-08-30 11:14:54

外键关系并不重要,水平分区基于表本身的值。外键只是确保它们已经存在于另一个表中。

链接:

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:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文