Recall & Review
beginner
What is range partitioning in PostgreSQL?
Range partitioning divides a table into parts where each part holds rows with values within a specific range. For example, a sales table can be partitioned by year ranges like 2020-2021, 2022-2023.
Click to reveal answer
beginner
How does list partitioning work in PostgreSQL?
List partitioning splits a table into parts based on a list of discrete values. For example, a table can be partitioned by country names like 'USA', 'Canada', 'Mexico'. Each partition holds rows matching those values.
Click to reveal answer
intermediate
Explain hash partitioning in PostgreSQL.
Hash partitioning distributes rows into a fixed number of partitions using a hash function on the partition key. It balances data evenly without ranges or lists, useful when data distribution is unknown.
Click to reveal answer
beginner
Which partition type would you use to split data by months?
Range partitioning is best for splitting data by months because months form continuous ranges of dates.
Click to reveal answer
intermediate
What is a key benefit of hash partitioning?
Hash partitioning evenly distributes data across partitions, which helps balance load and improve query performance when data values are unpredictable.
Click to reveal answer
Which partition type divides data based on continuous value ranges?
✗ Incorrect
Range partitioning splits data into partitions based on continuous ranges of values.
If you want to partition a table by specific countries, which partition type should you use?
✗ Incorrect
List partitioning is used to split data by specific discrete values like country names.
What does hash partitioning use to assign rows to partitions?
✗ Incorrect
Hash partitioning uses a hash function on the partition key to distribute rows evenly.
Which partition type is best when you want to balance data evenly but don't know the data distribution?
✗ Incorrect
Hash partitioning evenly distributes data without needing to know value ranges or lists.
Which partition type would you NOT use to split data by date ranges?
✗ Incorrect
Date ranges are best handled by range partitioning; list and hash partitioning are not suitable for continuous ranges.
Describe the differences between range, list, and hash partitioning in PostgreSQL.
Think about how data is divided in each type.
You got /3 concepts.
When would you choose hash partitioning over range or list partitioning?
Consider data balance and predictability.
You got /3 concepts.