30.08.2013 Aufrufe

Green-IT und Datenbanken - ODBMS

Green-IT und Datenbanken - ODBMS

Green-IT und Datenbanken - ODBMS

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

6 Energieoptimierungen<br />

dass der Index auf der Spalte o_orderdate dennoch verwendet wird. Für die Verlängerung<br />

der Laufzeit ist die Ausführung von Modul B verantwortlich, welches als<br />

erstes ausgeführt wird.<br />

Read index map SQLUser.ORDERS.OORDERDATEIDX,<br />

looping on O_ORDERDATE and ID.<br />

For each row:<br />

Add ID bit to bitmap temp-file A.<br />

Modul B schreibt jeden Eintrag aus der indizierten Spalte o_orderdate in eine temporäre<br />

Datei, mit der die weiteren Berechnungen für die Abfrage ausgeführt werden.<br />

Dies ist kostenintensiver als ein sequentielles Durchlaufen der Tabelle orders, wie es<br />

bei der Abfragebearbeitung ohne Index vorkommt (siehe dazu Abbildung 6.14). Hier<br />

Relative Kosten = 340833274<br />

Abfrageplan<br />

Call module C, which populates temp-file C.<br />

Read temp-file C, looping on O_TOTALPRICE, O_ORDERDATE, and a counter.<br />

For each row:<br />

Output the row.<br />

module C<br />

Call module B, which populates temp-file A.<br />

Read temp-file A, looping on O_TOTALPRICE, O_ORDERDATE, and ID.<br />

For each row:<br />

Read master map SQLUser.CUSTOMER.CUSTORMERPRIMARYIDX, using the given idkey<br />

value.<br />

Read master map SQLUser.LINE<strong>IT</strong>EM.LINE<strong>IT</strong>EMPRIMARYIDX, using the given L_ORDERKEY,<br />

and looping on L_LINENUMBER.<br />

For each row:<br />

Check distinct values for ID and ID using temp-file B,<br />

subscripted by a hashing of these values.<br />

For each distinct row:<br />

Add a row to temp-file C, subscripted by O_TOTALPRICE, O_ORDERDATE, and a<br />

counter,<br />

with node data of ID, C_NAME, ID, L_QUANT<strong>IT</strong>Y, the hashing, and [value].<br />

Update the accumulated sum(L_QUANT<strong>IT</strong>Y) in temp-file B,<br />

subscripted by the hashing.<br />

module B<br />

Read master map SQLUser.ORDERS.ORDERSPRIMARYIDX, looping on ID.<br />

For each row:<br />

Add a row to temp-file A, subscripted by O_TOTALPRICE, O_ORDERDATE, and ID,<br />

with node data of O_CUSTKEY.<br />

Call module H, which populates temp-file D.<br />

Read temp-file D, looping on a counter.<br />

For each row:<br />

subquery<br />

Abbildung 6.14: Abfrageplan TPC-H Abfrage 18 ohne zusätzlichen Index.<br />

werden in Modul B die Bearbeitungsschritte ausgeführt, die im Abfrageplan mit zu-<br />

Read temp-file E, using the given subscript values.<br />

sätzlichem Index Determine 6.13 subquery in Modul result. B <strong>und</strong> C ausgeführt werden. Beide Module führen<br />

eine Iteration über alle Elemente von o_orderdate aus.<br />

112<br />

module H<br />

Read master map SQLUser.LINE<strong>IT</strong>EM.LINE<strong>IT</strong>EMPRIMARYIDX, using the given L_ORDERKEY,<br />

and looping on L_LINENUMBER.<br />

For each row:<br />

Add a row to temp-file D, subscripted by a counter,<br />

with node data of L_ORDERKEY and L_QUANT<strong>IT</strong>Y.<br />

Add a row to temp-file E, subscripted by L_ORDERKEY,<br />

with node data of the accumulated sum(L_QUANT<strong>IT</strong>Y).

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!