This document discusses techniques for optimizing queries over partitioned tables in Massively Parallel Processing (MPP) database systems. It presents a model for representing partitioned tables and queries using PartitionSelector and DynamicScan operators. The PartitionSelector determines which partitions need to be scanned based on the query predicates, and DynamicScan scans the selected partitions. This allows generating plans that can defer partition selection to query runtime. The techniques were implemented in Pivotal Greenplum Database and shown to outperform conventional approaches by eliminating unnecessary partitions for complex queries like those involving joins.