Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

optimize sql query

-- ORACLE: get explain plan for a query
-- Without execution
EXPLAIN PLAN FOR select ...;
SELECT * FROM TABLE(dbms_xplan.display);
-- With execution
SELECT /*+ gather_plan_statistics */  ...;
SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'ALLSTATS LAST'));
 
PREVIOUS NEXT
Tagged: #optimize #sql #query
ADD COMMENT
Topic
Name
7+5 =