The demo was probably the other way round - index a character column and supply a numeric bind variable and Oracle has to coerce from character to number, which makes the index irrelevant.
GTTs - 10g style - add the problem that the default for optimizer_dynamic_sampling is 2, which means you sample tables without statistics when optimizing: so the GTT stats at explain plan time are not the same as the GTT stats at runtime.
Regards
Jonathan Lewis http://www.oracle.com/technology/community/oracle_ace/ace1.html#lewis
The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html
Cost Based Oracle: Fundamentals http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html
How often do people see inaccuracies in the explain plan?
One detail that may seem subtle, but it's important. Notice that EXPLAIN PLAN doesn't show an execution plan, it shows a *predicted* execution plan. Contrast this to the notion that there's a real execution plan in your trace data (if you've activated it) or in your V$ fixed views, but only after having executed the query in question.
Cary Millsap Hotsos Enterprises, Ltd. http://www.hotsos.com Nullius in verba
Hotsos Symposium 2007 / March 4-8 / Dallas Visit www.hotsos.com for curriculum and schedule details...
-----Original Message----- From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Wojciech Skrzynecki
Sent: Thursday, October 05, 2006 4:04 PM
To: oracle-l
Subject: script to see explain plan
Hello Everybody
I would like ask you to about explain plan. I am looking for the best script to see explain plan. I know that it is possible to see explain plan for active session of other users. I use script from metalink Note:260942.1. Maybe you use better scripts to see explain plan.
-- Wojciech Skrzynecki Database Administrator -- //www.freelists.org/webpage/oracle-l
-- //www.freelists.org/webpage/oracle-l
-- //www.freelists.org/webpage/oracle-l