
Answer-first summary for fast verification
Answer: Partition by department, as it is likely that queries will often filter by specific departments.
Partitioning by department allows for efficient querying of data from specific departments. This is often the most effective strategy for datasets where department-specific queries are common.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In a scenario where you have a dataset of employee records, which includes columns like employee_id, department, salary, and hire_date. Explain how you would decide on the appropriate partitioning strategy for this dataset to optimize query performance. Consider the frequency of queries and the nature of the data.
A
Partition by employee_id, as it is likely that queries will often filter by individual employees.
B
Partition by department, as it is likely that queries will often filter by specific departments.
C
Partition by salary, as it is likely that queries will often filter by salary ranges.
D
Partition by hire_date, as it is likely that queries will often filter by time ranges.
No comments yet.