From the course: Advanced SQL for Query Tuning and Performance Optimization
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Solution: Choosing how to partition a table - SQL Tutorial
From the course: Advanced SQL for Query Tuning and Performance Optimization
Solution: Choosing how to partition a table
(upbeat music) - [Instructor] The solution involves identifying the key requirements. In this case, it's comparing sales in one month to the same month in the prior year. Now, this makes some attribute around time or date a good candidate. Now, multiple products are mentioned and multiple products may be included in a query. So partitioning on individual products is not likely to help in performance because we'd just have to scan multiple partitions based on multiple products. So ideally, a column such as a sales date would be used for partitioning.