Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is table partitioning?

In which case we should use table partitioning?

like image 494
P Sharma Avatar asked Nov 30 '09 18:11

P Sharma


People also ask

What is table partitioning in SQL Server?

A partition function is a database object that defines how the rows of a table or index are mapped to a set of partitions based on the values of a certain column, called a partitioning column. Each value in the partitioning column is an input to the partitioning function, which returns a partition value.

What are the benefits of table partitioning?

Partitioning improves the performance of the delete old version shell script since all old version data is in a separate partition. By having all current version data in a separate partition, more current version data is available in database memory that results in efficient use of database buffer pools.

What is partitioning used for?

Partitioning is dividing of stored database objects (tables, indexes, views) to separate parts. Partitioning is used to increase controllability, performance and availability of large database objects. In some cases, partitioning improves performance when accessing the partitioned tables.


Video Answer


3 Answers

An example may help.

We collected data on a daily basis from a set of 124 grocery stores. Each days data was completely distinct from every other days. We partitioned the data on the date. This allowed us to have faster searches because oracle can use partitioned indexes and quickly eliminate all of the non-relevant days. This also allows for much easier backup operations because you can work in just the new partitions. Also after 5 years of data we needed to get rid of an entire days data. You can "drop" or eliminate an entire partition at a time instead of deleting rows. So getting rid of old data was a snap.

So... They are good for large sets of data and very good for improving performance in some cases.

like image 68
Philip Schlump Avatar answered Oct 06 '22 14:10

Philip Schlump


Partitioning enables tables and indexes or index-organized tables to be subdivided into smaller manageable pieces and these each small piece is called a "partition".

For more info: Partitioning in Oracle. What? Why? When? Who? Where? How?

like image 28
OMG Ponies Avatar answered Oct 06 '22 16:10

OMG Ponies


When you want to break a table down into smaller tables (based on some logical breakdown) to improve performance. So now the user can refer to tables as one table name or to the individual partitions within.

like image 7
Wade73 Avatar answered Oct 06 '22 14:10

Wade73