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

发布于 2024-11-02 22:29:28 字数 99 浏览 9 评论 0原文

在DDBMS中,垂直分段水平分段有什么区别?

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

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(9

岁月染过的梦 2024-11-09 22:29:28

假设你有一个亲戚,学生。

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

但是,如果我们的关系被划分,使得行的子集(例如,所有属性都存在于行中)出现在 site1 中,另一个子集出现在 site2 中,依此类推,这称为“水平碎片”,并且原始关系是通过所有集合的并集获得的。这就像水平撕纸一样。

很明显,这是在分布式 DBMS 的背景下。

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).

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.

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

青芜 2024-11-09 22:29:28

假设我们有这样的关系

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

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

碎片 1

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

碎片 2

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

垂直碎片是属性的子集

碎片 1

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

碎片 2

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

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

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

Fragment 2

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

Vertical fragmentation are subset of attributes

Fragment 1

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

Fragment 2

customer_id | Payment Type
      1     | Credit card 
      2     | Cash        
      3     | Cash        
情归归情 2024-11-09 22:29:28

原始表-。
输入图像描述这里


在此处输入图像描述

图像评论:完全由您选择如何在每个站点组装列。


  1. 按属性拆分原始表格(垂直)。
  2. 按照您喜欢的方式将这些片段分发到 DDBMS 的站点,然后重新组装它们。

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


输入图像描述这里


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

  2. 按照您喜欢的方式将这些片段分发到 DDBMS 的站点,然后重新组装它们。


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).


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.


向日葵 2024-11-09 22:29:28

仅分布式数据库需要垂直碎片。假设关系 R 之一具有多个属性。其中一些属性包含在 R1 中,其他属性包含在 R2 中。然后我们垂直连接页面。这称为垂直碎片。

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.

只涨不跌 2024-11-09 22:29:28

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

垂直碎片是将表碎片化为称为集合或站点的列,其中每个站点必须至少有一个共同的列,例如主键属性列(以便当碎片站点需要时可以再次使用)使用公共列形成整个(父)表)。
例如,EMPLOYEE 表具有 ENO (PRIMARY KEY)、ENAME、ADDRESS、EMAIL 和 ENO (PRIMARY KEY) 属性。薪水。将此表垂直分段为两个站点,例如 site1 和 site2。 site1 中的列是 ENO、ENAME 和 ENO、ENAME。地址。 site2 中的列是 ENO、EMAIL 和薪水。

Data fragmentation is an important feature of Distributed Database Management Systems (DDBMS)
Horizontal Fragmentation is 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.

Vertical Fragmentation is 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.

所有深爱都是秘密 2024-11-09 22:29:28

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

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

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

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

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

猫腻 2024-11-09 22:29:28

基本上水平碎片按行拆分表。
如果是垂直碎片,则按列拆分表。

水平碎片表中的内容与之前相同。仅拆分行。
在垂直碎片中,一张表分成两个或多个表。

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

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.

硬不硬你别怂 2024-11-09 22:29:28

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

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

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.

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.

那片花海 2024-11-09 22:29:28

简而言之,在水平碎片中,我们将表拆分为元组,这意味着在行中,只有我们拆分一行或两行,表的结构保持不变。
在垂直碎片中,我们根据属性列拆分表,我们从原始表中创建更多表

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

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