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

时间:2022-09-20 14:29:10

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.

我正在使用SQL Server,希望在表上创建一个分区。我想把它从另一个表的外键中提取出来。

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

我想根据表2的数据对表1进行分区,即如果表2包含类别

1 个解决方案

#1


4  

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:

链接:

#1


4  

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:

链接: