Database Reference
In-Depth Information
SQL> create table test1.t1 (a number, b number, c number, d number, e number, f number);
Table created.
SQL> insert into test1.t1 select level, level*10, level*100, level*1000, level*10000,
level*100000 from dual connect by level <= 100000;
100000 rows created.
SQL> commit;
Commit complete.
SQL> create index test1.i_t1 on test1.t1(a, b, c, d);
Index created.
SQL> select leaf_blocks from dba_ind_statistics where owner='TEST1' and index_name='I_T1';
LEAF_BLOCKS
-----------
427
SQL> delete from test1.t1 where a not in (1, 100000);
99998 rows deleted.
SQL> commit;
Commit complete.
SQL> exec dbms_stats.gather_table_stats('TEST1', 'T1')
PL/SQL procedure successfully completed.
SQL> select leaf_blocks from dba_ind_statistics where owner='TEST1' and index_name='I_T1';
LEAF_BLOCKS
-----------
2
SQL> select blocks from dba_segments where owner='TEST1' and segment_name='I_T1';
BLOCKS
----------
512
P.: „ Man muss also zusätzlich die statistische Anzahl der Leaf-Blöcke mit der Anzahl der
allozierten Index-Blöcke vergleichen.
L.: „ Ja, das ist nicht verkehrt. Du kannst wie immer sagen, dass es ein seltener Fall ist. In
meiner Praxis stieß ich aber mehrfach auf solche Probleme.
P.: „ Werden die ganz leeren Leaf-Blöcke überhaupt bei Index-Scans besucht?
L.: „ Ja, sie werden besucht, siehe die Laufzeitstatistik Buffers ' unten.
Search WWH ::




Custom Search