1-- ORACLE: get explain plan for a query
2-- Without execution
3EXPLAIN PLAN FOR select ...;
4SELECT * FROM TABLE(dbms_xplan.display);
5-- With execution
6SELECT /*+ gather_plan_statistics */ ...;
7SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'ALLSTATS LAST'));