Conclusion

When we write queries accessing partitioned tables, we should first pay attention to all the normal pitfalls surrounding query plan selection. In addition, partitioned tables bring further challenges in the area of partition elimination, statistics, and parallelism. When writing queries against partitioned tables, pay special attention to partition elimination (for example, ask whether your query provides enough information so that only some partitions will be accessed) and how parallelism works across multiple partitions. We have learned that the best way to investigate any issue affecting query execution is to analyze the Actual Execution Plans that contain information about query execution.

Get Inside Microsoft® SQL Server® 2008: T-SQL Querying now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.