Table of Contents

Data Partition - Partition Pruning (Elimination)

About

Partition Pruning is access paths methods that occurs when a table is partitioned by the column in the predicate. In this case, the database will read only the partitions involved and not the full table. The partitions not involved are eliminated (or pruned) from the scan.

ping Algebraic Optimization

Example

The product managers (PM) are interested in the sales figures of their respective products only, not in all the sales.

So the PM of product code “8” issues this SQL statement several times an hour:

select 
   sales_dt, 
   sum(amount), 
   avg (amount), 
   max(amount), 
   min(amount)
from sales
where product_code = 8
group by sales_dt;

To improve the performance of this query, you may:

Recall that list partitioning was preferred over range partitioning in this case because the PRODUCT_CODE is a discrete value.