From the course: Advanced SQL for Application Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Hash partitioning

Hash partitioning

From the course: Advanced SQL for Application Development

Start my 1-month free trial

Hash partitioning

- [Narrator] Another form of partitioning is partitioning by hash and hash partitioning is a type of horizontal partitioning. And here the way we decide where to put a row is by taking the partition key and dividing it by some number and then looking at the remainder. And then depending on the remainder, we decide which partition to use for storing the particular row. So in this example, we have a table that is partitioned into three partitions. So we divide the partition key by three and then depending on the remainder, determine whether the partition should go into the petition with remainder zero or remainder one or remainder two. Now again, as with other forms of horizontal petitioning, the partition key determines which partition is used to store the data. Now the modulus is the number of partitions we're going to use and that's the number we use for our division operation, our modulo division operation. Now,…

Contents