Home » RDBMS Server » Performance Tuning » How can I see the optimized SQL by CBO
How can I see the optimized SQL by CBO [message #141468] Mon, 10 October 2005 07:45 Go to next message
vgs2005
Messages: 123
Registered: April 2005
Senior Member
If I write a very complex SQL statement, I know that CBO makes it optimized sometimes by rewriting the query internally. How do I actually see this 'optmized' query?

thanks in advance..
Re: How can I see the optimized SQL by CBO [message #141482 is a reply to message #141468] Mon, 10 October 2005 08:23 Go to previous message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Hi,

Oracle doesn't change the physical query syntax, it just picks the optimal execution plan (or the plan it thinks is optimal). You can look at the plan by running an EXPLAIN PLAN (check the SQL Reference Guide for details).

One exception is when your create Materialized Views and enable Oracle's QUERY REWRITE feature. In such a case you need to enable SQL TRACING to see the rewritten statements.

Best regards.

Frank
Previous Topic: defragment in oracle
Next Topic: Why two sets of explain plans in tkprof..ed file??
Goto Forum:
  


Current Time: Fri Apr 19 00:10:21 CDT 2024