GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  PL/SQL

 Print  |  
Question:  Indexed Select Statement

Answer: How can we find the select statement is indexed or not?


September 09, 2009 14:22:53 #4
 promisinganuj   Member Since: September 2009    Total Comments: 3 

RE: Indexed Select Statement
 
1. using AUTOTRACE
SQL> SET AUTOTRACE ON TRACEONLY
SELECT *
    FROM emp
 WHERE emp_name = 'ABC';

2. Using EXPLAIN PLAN
SQL> EXPLAIN PLAN for
SELECT *
    FROM emp
 WHERE emp_name = 'ABC';

The advantage of using EXPLAIN PLAN over the AUTOTRACE is that former does not require the query to be actually run. The TRACEONLY option in AUTOTRACE just supress the query ouput but the query still runs before the explain plan is displayed.
     

 

Back To Question