Subject Re: [firebird-support] Re: Better plan for delete statement
Author Daniel Rail

At October 5, 2004, 05:18, Christian Kaufmann wrote:

>>Try this:
>>delete from A
>> where exist(select 1 from B
>> where (TYP = 3) and (PARENTID = 51) and
>> (B.AID=A.AID))

> no change here. The same plan is used:


True, I forgot that the optimizer will change your initial WHERE
clause to the one that I proposed. If this is a kind of delete
statement that you would be executing on a regular basis(even once a
month), creating a Stored Procedure(as Martjin suggested) will give
you the best performance.

>>statement that you are trying, but it would most likely require some
>>changes in Firebird's engine.
> Well, that's to much for me, since as Delphi programmer I don't have a
> good "relationship" with C++...

Don't worry, it's been 10 years since I've really programmed with C++.

Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (
ACCRA Med Software Inc. (