5

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.

LOURDHU KUMAR
  • 91
  • 1
  • 7

2 Answers2

6

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

fyr
  • 20,227
  • 7
  • 37
  • 53
2

For MySQL you want EXPLAIN: http://dev.mysql.com/doc/refman/5.0/en/explain.html

And on Oracle, it's EXPLAIN PLAN: http://docs.oracle.com/cd/B10500_01/server.920/a96533/ex_plan.htm

Polynomial
  • 27,674
  • 12
  • 80
  • 107