开发者

What are the benefits of vertical partitioning VS horizontal partitioning?

开发者 https://www.devze.com 2023-03-19 13:38 出处:网络
I simply cannot understand when or in what situation will we ever choose vertical partitioning instead of horizontal partitioning.

I simply cannot understand when or in what situation will we ever choose vertical partitioning instead of horizontal partitioning.

What are the benefits of vertical partitioning VS horizontal partitioning?

Are there any examples of websites / companies / anyone that uses vertical partitioning and what is/will be开发者_如何学编程 the main reason for that decision?


The main reason to have vertical partition is when there are columns in the table that are updated more often than the rest. You separate them in another table / partition, and when you are performing updates, you do not update the rest of the table. Example can be the posts counter. If it is in the same table as the other user data, each update of the counter (and there are lots) will lock the entire record, but you need to read it often. In vertical partitioning, the updated table will be user_counters, and the performance of users won't be affected of the number of updates.


I totally agree with what Darhazer has said.

There are two major forms of partitioning:

  1. Horizontal Partitioning - this form of partitioning segments table rows so that distinct groups of physical row-based datasets are formed that can be addressed individually (one partition) or collectively (one-to-all partitions). All columns defined to a table are found in each set of partitions so no actual table attributes are missing. An example of horizontal partitioning might be a table that contains ten years worth of historical invoice data being partitioned into ten distinct partitions, where each partition contains a single year's worth of data.
  2. Vertical Partitioning - this partitioning scheme is traditionally used to reduce the width of a target table by splitting a table vertically so that only certain columns are included in a particular dataset, with each partition including all rows. An example of vertical partitioning might be a table that contains a number of very wide text or BLOB columns that aren't addressed often being broken into two tables that has the most referenced columns in one table and the seldom-referenced text or BLOB data in another

Copied from http://mysql.localhost.net.ar/tech-resources/articles/performance-partitioning.html

0

精彩评论

暂无评论...
验证码 换一张
取 消