Subject Re[4]: [ib-support] Strange query problem
Author Daniel Rail

> But, here it is another one:

> "select
> pty.party_id, bill.due_date, bill.service_tax
> from
> tbl_party pty join tbl_bill bill on (bill.account_id = pty.account_id) and bill.service_id = 1
> where
> not exists (select * from tbl_invalid inv where inv.party_id = pty.party_id)"

> All of the fields you see here except "bill.due_date" and
> "bill.service_tax" are indexed fields.

> This query without the WHERE clause executes fast (1400 ms). When
> I put the WHERE clause it goes to something like 15 minutes :((

What is the PLAN that is being generated?

Also, out of curiosity, what would happen if what you have in WHERE
clause would be integrated in the FROM clause as another JOIN, and
drop the WHERE clause.

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