Re: Oratcl Bind Queries
From: Adrian Bowen (raptor_at_gotadsl.co.uk)
Date: 06/08/04
- Next message: Bruce Hartweg: "Re: How to split a string in bytes?"
- Previous message: Bruce Hartweg: "Re: Interesting feature of tcl"
- In reply to: Miguel Ba??n: "Re: Oratcl Bind Queries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 8 Jun 2004 20:13:07 +0100
"Miguel Ba??n" <spanmeifyoucan@hotmail.com> wrote in message
news:892a12e7.0406081010.e66a95a@posting.google.com...
> "Adrian Bowen" <raptor@gotadsl.co.uk> wrote in message
news:<40c554ce$0$6330$65c69314@mercury.nildram.net>...
> > Hi Damon,
> >
> > I don't know if this is the cause of the problem you're seeing or not,
but
> > the use of bind variables can, I believe, radically alter the execution
plan
> > that Oracle uses for a given query, specifically when the cost based
> > optimiser (CBO) is used.
>
<snip>
> So would you suggest not to use bind variables as a general rule?
Well, I am not an Oracle expert by any means, but I think the general
consensus is that one should *always* use bind variables wherever possible
to avoid the overhead of hard parses, and to allow as many queries and
execution plans as possible to be cached efficiently in the SGA.
However, unless Oracle 9 or Oracle 10 have significantly improved the way
the CBO works, you will need to manually 'hint' the query plan for these
queries, based on your a priori knowledge of the value distributions in the
tables you are joining. In practice this is fairly simple, you just let
Oracle know (by way of the hints) which order to do the joins in so as to
reduce the number of rows being considered as quickly as possible.
As I said, this may not be the cause of the problem you are seeing, but it
is a possibility.
Adrian
- Next message: Bruce Hartweg: "Re: How to split a string in bytes?"
- Previous message: Bruce Hartweg: "Re: Interesting feature of tcl"
- In reply to: Miguel Ba??n: "Re: Oratcl Bind Queries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|