The Oracle Sponge

Oracle Data Warehouse Design and Architecture

Archive for October 28th, 2006

Partition Pruning and Bind Variables

Posted by David Aldridge on 2006-10-28

Prompted by a question at the Dizwell Forum, here is a script to demonstrate that using bind variables in partition key predicates causes Oracle to use global (table) statistics instead of partition (or subpartition) statistics.

Script

Result on 9.2.0.4

This is similar behaviour to Oracle’s use of global statistics in other circumstances, such as when joining on a partition key to a smaller table on which a predicate is placed. Anyway, see the forum post for other comments :D

Posted in Oracle, Partitioning, Performance, Statistics | 9 Comments »