The summary of ‘MSSQL – What is Table Partitioning Explained’

This summary of the video was created by an AI. It might contain some inaccuracies.

00:00:0000:05:49

Code Cowboy delves into the intricacies of table partitioning, a database management technique that breaks down a large table into smaller, more manageable chunks based on specified criteria—in this case, by year. He outlines the creation of a partition function and a partition scheme to map different date ranges to separate file groups, which effectively creates virtual tables for each year without altering the application. Through a comparison, he demonstrates that while a non-partitioned database maintains 40 million rows per index, a partitioned database spreads these rows across multiple partitions, significantly improving data management efficiency. Each partition corresponds to a different year, with varying row counts, and includes future partitions that remain empty until data is added. Additionally, the video touches on how indexes are managed in the context of partitioning, highlighting that partition-aligned indexes are distributed across different partitions, while non-partitioned indexes encompass all partitions.

00:00:00

In this part of the video, Code Cowboy explains table partitioning in layman’s terms. He demonstrates with a table containing 40 million rows and describes how to split this table into smaller chunks by year. He outlines the process of creating a partition function and a partition scheme to map date ranges to file groups. By partitioning the table, it essentially creates virtual tables for each year (e.g., 2005, 2006, etc.). This storage scheme simplifies data management without requiring changes to the application. Code Cowboy then shows the differences between a non-partitioned and partitioned database, illustrating that non-partitioned databases have a single partition where each index maintains 40 million rows.

00:03:00

In this part of the video, the speaker demonstrates the differences between a partitioned and a non-partitioned database by showing a query on the sales order header table. The partitioned database has 17 partitions, with the number of rows varying significantly across partitions. For example, the 2005 partition has 38,000 records, while the 2006 and 2007 partitions have 1.6 million and 3.7 million records, respectively. The speaker explains that partitioning is based on a partition function and includes future partitions for years like 2016 and 2017, which are currently empty.

The video also explains how indexes are related to partitioning. A partition-aligned index is created by specifying the partition scheme and the column to be partitioned. This results in an index split across different partitions, each with its own set of rows. Conversely, non-partitioned indexes span all partitions, maintaining 40 million rows across each index. The speaker hints at additional videos available for a deeper dive into table partitioning concepts.

Scroll to Top