Pages

Wednesday 22 June 2011

MS SQL Server 2008 Database Partitioning

You should use the horizontal partitioning method to improve database performance. This method allows you to divide a single large table into multiple smaller tables with fewer rows and an equal number of columns. Horizontal partitioning allows you to reduce the table data depending on your requirements. For instance, if a table contains data from the last ten years, and you frequently access only the current year's data,
you can horizontally partition the table into 10 tables. Each table in this method would represent data for a specific year. Database performance is enhanced because you are accessing only a specific year's data from an individual table when queries are executed. Therefore, it provides quicker response time and enhanced data performance because less data is scanned.

When you apply horizontal partitioning on a table that contains a large number of rows, you will be able to split the table into fewer rows and the same number of columns. With horizontal partitioning, the number of rows is split across multiple tables but the number of columns remains the same. You gain a performance benefit because you will have fewer rows to work with. Horizontal partitioning allows you to
split the rows across multiple tables depending on your needs.As an example, you can split the table into four different tables where each table represents data for a specific quarter for the year. However, in this type of partitioning, the number of columns always remains the same across multiple tables.In vertical partitioning, you will have the same number of rows but fewer columns. In vertical partitioning, the columns are divided amongst multiple tables with the same number of rows. Vertical partitioning can be of two types: normalization and row splitting. In normalization, redundant columns are removed from the primary table and moved into secondary tables. The redundant columns are then linked with the primary table using primary or foreign key. In row splitting, fewer columns are retained, which means that each row contains a portion of the logical row in the partitioned table.

No comments:

Post a Comment