Freitag, September 14, 2012

Predicate Pushdown

In dieser Woche bin ich einem Fall begegnet, in dem ein Predicate Pushdown aufgrund falscher Cardinality-Schätzungen für einen vorangehenden Join zu einer recht unglücklichen Nested Loops Operation führte. Zu Erinnerungszwecken daher hier die kurze Definition aus Maria Colgans (oder Rafi Ahmeds?) einführendem Artikel zum Thema:
In the join predicate pushdown transformation, the view remains a separate query block, but it contains the join predicate, which is pushed down from its containing query block into the view. The view thus becomes correlated and must be evaluated for each row of the outer query block. These pushed-down join predicates, once inside the view, open up new index access paths on the base tables inside the view; this allows the view to be joined with index-based nested-loop join method, thereby enabling the optimizer to select an efficient execution plan.
Bei einer korrekten Schätzung der Schleifen-Iterationen kann das natürlich sehr nützlich sein.

Keine Kommentare:

Kommentar veröffentlichen