Mittwoch, Juli 27, 2011

Nested Loops Prefetching

Randolf Geist erläutert in seinem Artikel Logical I/O - Evolution: Part 2 - 9i, 10g Prefetching einige technische Details des Prefetchings bei NL Operationen. Offenbar spielt die Sortierung der Daten in den beiden via NL verknüpften Tabellen eine entscheidende Rolle:
Table Prefetching has been introduced in Oracle 9i in order to optimize the random physical access in Nested Loop Joins, however it also seems to have a positive effect on logical I/O. The effectiveness of this optimization depends on the data order - if the data from the driving row source is in the same order as the inner row source table buffers can be kept pinned. Note that the same doesn't apply to the index lookup - even if the data is ordered by ID and consequently the same index branch and leaf blocks will be accessed repeatedly with each iteration, a buffer pinning optimization could not be observed.
Im Beispiel wird auch deutlich, wie unterschiedlich sich als unique und als non-unique definierte Indizes in diesem Zusammenhang verhalten - was möglicherweise ein Argument gegen den Einsatz von non uninque indexes für primary keys sein mag.

Keine Kommentare:

Kommentar veröffentlichen