建了索引執行計劃會有區別了

bulletming發表於2019-03-30
慢慢的需要熟悉這些個執行計劃的輸出

SQL> select log_datetime,source_channel,time1,time3 from log_ga,test_timestamp where log_datetime=time1;

no rows selected


Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 MERGE JOIN
2 1 SORT (JOIN)
3 2 TABLE ACCESS (FULL) OF 'TEST_TIMESTAMP'
4 1 SORT (JOIN)
5 4 TABLE ACCESS (FULL) OF 'LOG_GA'


Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
6 consistent gets
0 physical reads
0 redo size
396 bytes sent via SQL*Net to client
372 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
2 sorts (memory)
0 sorts (disk)
0 rows processed

SQL>
SQL>
SQL> create index IDX_LOG_GA_LOG_DATETIME on log_ga (log_datetime);

Index created.

SQL>
SQL>
SQL>
SQL> select log_datetime,source_channel,time1,time3 from log_ga,test_timestamp where log_datetime=time1;

no rows selected


Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'LOG_GA'
2 1 NESTED LOOPS
3 2 TABLE ACCESS (FULL) OF 'TEST_TIMESTAMP'
4 2 INDEX (RANGE SCAN) OF 'IDX_LOG_GA_LOG_DATETIME' (NON-U
NIQUE)

Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
4 consistent gets
0 physical reads
0 redo size
396 bytes sent via SQL*Net to client
372 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/82392/viewspace-144674/,如需轉載,請註明出處,否則將追究法律責任。

相關文章