|Subject||Re: [ib-support] WHERE optimization|
>1) Is bill.service_id selective? I.e. does there only exist one or a fewActually bill.service_id is not very selective. Do you think there will be some
>rows in the table with each value? If not, this field should not be indexed.
performance gain if I delete the index on bill.service_id?
>2) Why do you use "not exists (select * from tbl_invalid inv whereI read somewhere that using "select * ..." in cases like this is
>inv.party_id = pty.party_id)"? Change it to "not exists (select 1 from
>tbl_invalid inv where inv.party_id = pty.party_id)".
faster, but I will try "select 1 ..." as well.
>I think this is determined by the plan. The plan tries to retrieve theI don't know. What I know is that Oracle, for example, evaluates the
>records as cheap as possible, and will start by evaluating what it
>perceives to be the most restrictive predicate having an index (please
>correct me if I'm wrong).
predicates in the WHERE clause from the last to the first one.
So, I wanted to know if Interbase does something similar :)