Partition (database)

From Wikipedia, the free encyclopedia

A partition is a division of a logical database or its constituting elements into distinct independent parts.

Database partitioning is normally done for manageability, performance or availability reasons.

The partitioning can be done by either building separate smaller databases (each with its own tables, indexes, and transaction logs), or by splitting selected elements, for example just one table.

Horizontal partitioning involves putting different rows into different tables. Perhaps customers with ZIP Codes less than 50000 are stored in CustomersEast, while customers with ZIP Codes greater than or equal to 50000 are stored in CustomersWest. The two partition tables are then CustomersEast and CustomersWest, while a view with a union might be created over both of them to provide a complete view of all customers.

Vertical partitioning involves creating tables with fewer columns and using additional tables to store the remaining columns. Normalization is a process that inherently involves vertical partitioning. Different physical storage might be used to realize vertical partitioning as well; storing infrequently used or very wide columns on a different device, for example, is a method of vertical partitioning. Done explicitly or implicitly, this type of partitioning is called "row splitting". A common form of vertical partitioning is to split (slow to find) dynamic data from (fast to find) static data in a table where the dynamic data is not used as often as the static. Creating a view across the two newly created tables restores the original table with a performance penalty, however performance will increase when accessing the static data e.g. for statistical analysis.

[edit] Partitioning criteria

Current high end relational database management systems provide for different criteria to split the database. They take a partitioning key and assign a partition based on certain criteria. Common criteria are:

Range partitioning 
Selects a partition by determining if the partitioning key is inside a certain range. An example could be a partition for all rows where the column zipcode has a value between 70000 and 79999.
List partitioning 
A partition is assigned a list of values. If the partitioning key has one of these values, the partition is chosen. For example all rows where the column Country is either Iceland, Norway, Sweden, Finland or Denmark could build a partition for the Nordic countries.
Hash partitioning 
The value of a hash function determines membership in a partition. Assuming there are four partitions, the hash function could return a value from 0 to 3.

Composite partitioning allows for certain combinations of the above partitioning schemes, by for example first applying a range partitioning and then a hash partitioning.

[edit] External links


Topics in database management systems (DBMS)view  talk  edit )

Concepts
Database • Database model • Relational database • Relational model • Relational algebra • Primary key, Foreign key, Surrogate key, Superkey, Candidate key • Database normalization • Referential integrity • Relational DBMS • Distributed DBMS • ACID

Objects
Trigger • View • Table • Cursor • Log • Transaction • Index • Stored procedure • Partition

Topics in SQL
Select • Insert • Update • Merge • Delete • Join • Union • Create • Drop

Implementations of database management systems

Types of implementations
Relational • Flat file • Deductive • Dimensional • Hierarchical • Object oriented • Temporal • XML data stores

Components
Query language • Query optimizer • Query plan • ODBC • JDBC

Database products

Apache Derby • Berkeley DB • Caché • DB2 • db4o • DBase • eXtremeDB • Filemaker Pro • Firebird • Greenplum • H2 • Helix • Informix • Ingres • InterBase • Linter • Microsoft Access • Microsoft SQL Server • Mimer SQL • MonetDB • MySQL • Objectivity/DB • OpenLink Virtuoso • OpenOffice.org Base • Oracle • Oracle Rdb • Paradox • Perst • PostgreSQL • SQLite • Sybase IQ • Sybase • Teradata • UniVerse • Visual FoxPro


Other: Object-oriented (comparison) • relational (comparison)

In other languages