Você está na página 1de 1

Partition Pruning

Partition pruning is an essential performance feature for data warehouses. In partition pruning, the optimizer analyzes FROM and WH R clauses in !"# statements to eliminate un$needed partitions when %uilding the partition access list. &his functionality ena%les Oracle 'ata%ase to perform operations only on those partitions that are rele(ant to the !"# statement. Partition pruning dramatically reduces the amount of data retrie(ed from dis) and shortens processing time, thus impro(ing *uery performance and optimizing resource utilization. If you partition the inde+ and ta%le on different columns ,with a glo%al partitioned inde+-, then partition pruning also eliminates inde+ partitions e(en when the partitions of the underlying ta%le cannot %e eliminated. 'epending upon the actual !"# statement, Oracle 'ata%ase may use static or dynamic pruning. !tatic pruning occurs at compile$time, with the information a%out the partitions accessed %eforehand. 'ynamic pruning occurs at run$time, meaning that the e+act partitions to %e accessed %y a statement are not )nown %eforehand. . sample scenario for static pruning is a !"# statement containing a WHERE condition with a constant literal on the partition )ey column. .n e+ample of dynamic pruning is the use of operators or functions in the WHERE condition. Partition pruning affects the statistics of the o%/ects where pruning occurs and also affects the e+ecution plan of a statement.

Static Partition Pruning


For a num%er of cases, Oracle determines the partitions to %e accessed at compile time. &his happens when the predicates on the partitioning columns use a range predicate. In addition, the predicates must only use constants so that Oracle can determine the start and stop partition num%ers at compile time. When this happens, the actual partition num%ers show up in the partition start partition stop columns of the e+plain plan.

Dynamic Partition Pruning


Oracle 'ata%ase con(erts the pruning predicates into a partition num%er at compile time whene(er it can. Howe(er, there are a num%er of cases when this is not possi%le. For e+ample, if a predicate on a partitioning column in(ol(es a %ind (aria%le, Oracle cannot determine the partition num%ers at compile time. (en if %ind (aria%les are not used, for certain classes of predicates such as IN$list predicates Oracle accesses a list of predicates not a range. In all these cases, the e+plain plan will show KEY in the partition start and stop columns. &here is also some information a%out the type of predicate used. For e+ample, if an IN$list predicate was used, the plan output will show KEY(I) in the partition start and stop column.

more0 more10

Você também pode gostar