database 分布式数据库管理系统 (DDBMS) 中的水平与垂直碎片化

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5777234/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:10:37  来源:igfitidea点击:

Horizontal vs Vertical Fragmentation in Distributed Database Management Systems (DDBMS)

databasedistributedfragmentation

提问by DreX

In the context in DDBMS, what is the difference between Vertical Fragmentationand Horizontal Fragmentation?

在 DDBMS 的上下文中,Vertical FragmentationHorizo​​ntal Fragmentation 有什么区别?

Is it such that the relation's extension is fragmented for vertical fragmentation and intension fragmentation is horizontal fragmentation?

是不是关系的外延被分割为垂直的碎片,内涵的碎片是水平的碎片?

回答by Sanjay Rajpal

Suppose you have a relation, Student.

假设你有一个关系,学生。

You divide relation Student in two sets (call them set1 and set2) such that half of the attributes of Student are in set1 and half of them are in set2. This is called 'vertical fragmentation', as a relation is fragmented along columns (similar to tearing a page vertically). Original relation is obtained by take the natural join of all the sets. For the natural join we require at least one attribute which is common to all the sets(generally it is the primary key).

您将关系 Student 分成两个集合(称为 set1 和 set2),这样 Student 的一半属性在 set1 中,一半在 set2 中。这称为“垂直碎片化”,因为关系是沿列碎片化的(类似于垂直撕开页面)。原始关系是通过对所有集合进行自然连接而获得的。对于自然连接,我们需要至少一个所有集合共有的属性(通常它是主键)。

But if our relation divided so that a subset of rows (see here all attributes are present in rows) is present with site1 (for example), another subset is present with site2, and so on, this is called 'horizontal fragmentation', and original relation is obtained by taking the union of all the sets. It's like tearing a page horizontally.

但是,如果我们的关系划分为一个行的子集(参见此处所有属性都存在于行中)存在于 site1(例如),另一个子集存在于 site2,依此类推,这称为“水平碎片化”,并且通过对所有集合取并集得到原始关系。这就像水平撕开一页。

As is clear, this is in the context of Distributed DBMS.

很明显,这是在分布式 DBMS 的上下文中。

回答by Bikal Basnet

Say we have this relation

说我们有这个关系

customer_id | Name | Area       | Payment Type  | Sex
      1     | Bob  | London     | Credit card   | Male
      2     | Mike | Manchester | Cash          | Male
      3     | Ruby | London     | Cash          | Female

Horizontal Fragmentation are subsets of tuples (rows)

水平分片是元组(行)的子集

Fragment 1

片段 1

customer_id | Name | Area       | Payment Type  | Sex
      1     | Bob  | London     | Credit card   | Male
      2     | Mike | Manchester | Cash          | Male

Fragment 2

片段 2

customer_id | Name | Area       | Payment Type  | Sex
      3     | Ruby | London     | Cash          | Female

Vertical fragmentation are subset of attributes

垂直碎片化是属性的子集

Fragment 1

片段 1

customer_id | Name | Area       | Sex
      1     | Bob  | London     | Male
      2     | Mike | Manchester | Male
      3     | Ruby | London     Female

Fragment 2

片段 2

customer_id | Payment Type
      1     | Credit card 
      2     | Cash        
      3     | Cash        

回答by SANTOSHI SAHU

Data fragmentation is an important feature of Distributed Database Management Systems (DDBMS) Horizontal Fragmentationis splitting of tables horizontally that is into tuples or rows. For example, a COMPANY table having 1000 records can be horizontally fragmented into ten fragments, each fragment having 100 unique records.

数据碎片是分布式数据库管理系统 (DDBMS) 的一个重要特性。 水平碎片是将表水平拆分为元组或行。例如,具有 1000 条记录的 COMPANY 表可以水平分割为 10 个片段,每个片段有 100 个唯一记录。

Vertical Fragmentationis fragmenting of table into columns known as set or site, where every site must have at least one column in common such as the primary key attribute column (so that when the fragmented sites when needed can again be formed to a whole (parent) table using the common column). For example, the EMPLOYEE table having attributes as ENO (PRIMARY KEY), ENAME, ADDRESS, EMAIL & SALARY. Vertically fragmenting this table into two sites such as site1 and site2. Columns in site1 are ENO, ENAME & ADDRESS. Columns in site2 are ENO, EMAIL & SALARY.

Vertical Fragmentation是将表分割成称为 set 或 site 的列,其中每个站点必须至少有一个共同的列,例如主键属性列(以便在需要时可以将碎片化的站点再次形成一个整体(父) 表使用公共列)。例如,EMPLOYEE 表的属性为 ENO (PRIMARY KEY)、ENAME、ADDRESS、EMAIL 和 SALARY。将此表垂直拆分为两个站点,例如站点 1 和站点 2。site1 中的列是 ENO、ENAME 和 ADDRESS。site2 中的列是 ENO、EMAIL 和 SALARY。

回答by sourav roy

Vertical fragmentation is required only for distributed databases. Say one of relation R has several attributes. Some of these attribute is consist in R1 and other is R2. Then we are joining page vertically. This is called vertical fragmentation.

只有分布式数据库才需要垂直碎片化。假设关系 R 之一有几个属性。这些属性中的一些存在于 R1 中,而另一些存在于 R2 中。然后我们垂直加入页面。这称为垂直碎片化。

回答by K Senthil Kumar

Horizontal Fragmentation divides the relation into tuples called rows

水平分片将关系划分为称为行的元组

Vertical fragmentation divides the relation into attributes called columns.

垂直碎片将关系划分为称为列的属性。

Depending upon our application view requirement, we can fragment the relation into horizontal or vertical.

根据我们的应用程序视图要求,我们可以将关系分割成水平或垂直。

The degree for fragmentation & correctness rule based on application view

基于应用视图的碎片化程度和正确性规则

回答by Abhishek Kanrar

Basically Horizontal Fragmentation splits tables by row wise . In case of vertical Fragmentation splits table column wise.

基本上 Horizo​​ntal Fragmentation 按行拆分表。在垂直碎片的情况下,明智地拆分表格列。

In the Horizontal Fragmentation Table remain same as previous.Only the rows are splits. In Vertical Fragmentation one table splits into two or more tables.

在水平碎片表中保持与以前相同。只有行是拆分的。在Vertical Fragmentation 中,一张表分成两个或多个表。

回答by shahzeb salim

Horizontal Fragmentation splits tables by rows. It differs from Vertical Fragmentation in that the relationship between key columns and non-key columns remains the same. The content of the tables differ by key value.

水平分段按行拆分表。它与Vertical Fragmentation 的不同之处在于键列和非键列之间的关系保持不变。表的内容因键值而异。

Horizontal fragmentation e.g: The company wants each department to maintain its own data. In this example, there would be only one row in each department's Department table, and the other tables contain only the data for the department's employees.

横向碎片化 例如:公司希望每个部门都维护自己的数据。在此示例中,每个部门的 Department 表中只有一行,其他表仅包含该部门员工的数据。

回答by Shahab Khan Khalil

In simple words in Horizontal fragmentation we split the table into tuples mean in rows the structure of table remain same only we split the one or tow rows . In vertical fragmentation we split the table with respect to attribute column we make moer table from the original table

简单地说,在水平碎片中,我们将表拆分为元组,这意味着在行中,表的结构保持不变,只是我们拆分了一行或两行。在垂直碎片中,我们根据属性列拆分表,我们从原始表中制作了更多表

回答by Sebastian Nielsen

Original table-. enter image description here

原表-。 在此处输入图片说明



enter image description here

在此处输入图片说明

Image comment: It's completely up to you choose how the columns is assembled at each site.

图片评论:完全取决于您选择如何在每个站点组装柱子。



  1. Split the original table up (vertically) by attributes.
  2. Distribute the pieces to the sites of your DDBMS however you like and reassemble them.

    (Usually you want to include the primary key column into each of the fragments, so that you can obtain the original table again if needed).

  1. 按属性向上(垂直)拆分原始表。
  2. 随意将这些片段分发到 DDBMS 的站点,然后重新组合它们。

    (通常您希望将主键列包含到每个片段中,以便您可以在需要时再次获取原始表)。



enter image description here

在此处输入图片说明



  1. Split the original table up (horizontally) by row.

  2. Distribute the pieces to the sites of your DDBMS however you like and reassemble them.

  1. 按行拆分(水平)原始表。

  2. 随意将这些片段分发到 DDBMS 的站点,然后重新组合它们。