Subject | Re: [ib-support] Please help me with query plan |
---|---|
Author | Andrew Guts |
Post date | 2003-01-17T14:35:53Z |
Daniel Rail wrote:
is a better way.
Thank you.
>Try reorganizing your query.Default plan is the same for your version. I agree, reorganizing query
>
>Here's how I would write it:
>
>select sum(x.Price*x.Qty/d.Rate)
> from xfers x
> inner join docs d on ((x.docid=d.id) and (d.customerid=x.dstid))
> where (x.dstid=:id)
> and (d.DepID=:dep)
> and (d.DocDate<CURRENT_TIMESTAMP)
> and exists (select *
> from optypes t
> where (t.id=x.typeid)
> and (t.factor<>0))
>
>
is a better way.
Thank you.