Need to know about the execution plan of the queries

advertisements

Is there any way to view the mysql/oracle query execution plan as like java debugging. i want to know how mysql/oracle executes our query and what are the steps involved in execution.


For mysql you should use

EXPLAIN <query>

e.g.

EXPLAIN SELECT * FROM tableX

see mysql reference

For oracle there is something similar but more detailed:

EXPLAIN PLAN FOR <query>

e.g.

EXPLAIN PLAN FOR SELECT * FROM tableX

see also: reference for oracle