11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

132 CHAPTER 3 ■ DATABASE ADMINISTRATIONPredicate Information (identified by operation id):---------------------------------------------------1 - filter("EDBA_DOCUMENT_ID"=1280)You can clearly see that the optimizer does not pick up the index hint and opts to performa full table scan. If you want the optimizer to take the invisible index into account, you mustuse the index hint, as shown in the following example:1 select /*+ index (edba_documents EDBA_DOCUMENTS_I10) */2 edba_document_id3 from edba_documents4* where edba_document_id=128019:07:35 SQL> /Elapsed: 00:00:00.00Execution Plan--------------------------------------------------------------------------------------Plan hash value: 2328900544--------------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time|| 0 | SELECT STATEMENT | | 1 | 3 | 1 (0)|00:00:01 ||* 1 | INDEX RANGE SCAN| EDBA_DOCUMENTS_I10 | 1 | 3 | 1 (0)|00:00:01 |--------------------------------------------------------------------------------------Predicate Information (identified by operation id):--------------------------------------------------------------------------------------1 - access("EDBA_DOCUMENT_ID"=1280)The explain plan for the select statement with the index hint reveals that the optimizerperforms an index range scan instead of a full table scan, owing to it taking the invisible indexinto account.Checking the Visibility Status of an Index<strong>Oracle</strong> <strong>Database</strong> <strong>11</strong>g has added a new column named visibility to the DBA_INDEXES table toenable the checking of an index’s visibility status. Use the following command to check thevisibility status of an index:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!