From: holders <holders@demon.co.uk>
Subject: Re: Host variable
Date: 2000/08/08
Message-ID: <39901AC8.49E8DD0@demon.co.uk>#1/1
Content-Transfer-Encoding: 7bit
X-NNTP-Posting-Host: holders.demon.co.uk:158.152.189.12
References: <8mnh2f$sjf$1@nnrp1.deja.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@demon.net
X-Trace: news.demon.co.uk 965745687 nnrp-01:16163 NO-IDENT holders.demon.co.uk:158.152.189.12
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.server


Hello,

My assumption here is that you are using the cost based optimizer. The
problem with bind variables is that the optimizer does not its values and
therefore cannot use all gather statistics as opposed to a literal SQL for
which it does
SH.

vidvas@hotmail.com wrote:

> I've a query joining 2 tables. Here's the query.
>
>  SELECT distinct a.ID
>        from  a,b
>        where a.id = b.acct_id
>        and  ( a.Modified_date >= (to_date(:zdate),'YYYYMMDDHH24MISS'))
>         or  ( b.Modified_date >= (to_date(:zdate,'YYYYMMDDHH24MISS'))))
>
> If host variable is used, it takes 3 - 4 hours to give the results. and
> when i hard code the date parameter, it takes only  acouple of minutes.
> Any suggestions?
>
> thanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



