Barbara,

    The path that the optimizer chooses is based on what values are bound into
the variables, but also on what information it has in the data dictionary.  If
those particular tables/indexes have not been analyzed recently then the
optimizer will make wrong decisions.  Also init parameters like
db_file_multiblock_read_count can prejudice the optimizer to a particular path
over others.  I would not so much blame the use of bind variables before looking
at the data dictionary entries for the table/indexes and the init.ora file.  And
yes, the optimizer in 7.x was flaky, at best.

Dick Goulet

____________________Reply Separator____________________
Author: "Baker; Barbara" <[EMAIL PROTECTED]>
Date:       7/22/2002 7:08 AM

prem.
Never did get an answer to this question.  I don't know why using bind
variables changed the execution path.  My best guess comes from the
developer.  She thinks that when we supplied the values, the optimizer knew
what the range of values would be, and could therefore determine to use the
index.  With the bind variable, the optimizer did not have a range of values
to work with and therefore did not choose the index in the execution path.

I have no knowledge that using bind variables will suppress indexes.  Just
happened that it did in this case.
Also keep in mind that this particular database is using an old version of
Oracle (7.3.4).  Optimizer got much better in version 8.

The list helped me out with a work-around, which was to index-hint the index
I wanted.

Bind variables are definitely "good guys".  I highly recommend you continue
with your code changes to include binds.

Good luck.
Barb


> ----------
> From:         oraora  oraora[SMTP:[EMAIL PROTECTED]]
> Reply To:     oraora  oraora
> Sent:         Sunday, July 21, 2002 8:24 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: bind vars change explain plan
> 
> Baker,
> 
> sorry i did not read the reply to ur query.
> what was the reply ?
> will using bind vars suppress index ?
> kindly let me know b'coz i have also changed my code to SQL with 
> bind vars just now.
> 
> Regards,
> prem.
> 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Baker, Barbara
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to