Amazon Interview Question

What is partitioning in SQL?

Interview Answer

Anonymous

Jan 7, 2022

Partitioning is a method of breaking a large dataset into smaller subsets. It is a process where very large tables are divided into multiple smaller parts. By splitting a large table into smaller, individual tables, queries that access only a fraction of the data can run faster because there is less data to scan. The main goal of partitioning is to aid in maintenance of large tables and to reduce the overall response time to read and load data for particular SQL operations. Vertical partitioning splits a table into two or more tables containing different columns. Horizontal partitioning divides a table into multiple tables that contain the same number of columns, but fewer rows.