Subject Re: [ib-support] Question on delete
Author Paolo Fainelli
Louis,
Thanks for your answer. I've modified my query and now the plan use primary
key, but result is ... slower !!!!!
It seems that FB ( version 1.02 ) scan mytable from the beginning to the
end. Using Interbase PlanAnalizer I discover that subquery need 2ms to
complete , original query more than 3 sec.
Maybe it's better to rewrite this query in another way ( I'm using delphi ).


Paolo


> I have used techniques like adding other WHERE phrases to solve this type
of
> problem in the past. In you situation, assuming all the ID values are >
0,
> I would write the query as follows:
>
>
>
> delete from mytable
>
> where (mytable.id > 0)
>
> and (mytable.id in ( select id from listtable where <search
condition> ))
>
>
>
> HTH
>
>
>
> Louis Kleiman
>
> SSTMS, Inc.
>