Subject | Re: [ib-support] WHERE optimization |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2003-02-13T13:10:07Z |
At 14:40 13.02.2003 +0200, you wrote:
your plan and you do have an index for bill.account_id that is selective,
then yes, I think performance would improve.
better. And what is less than a constant number? If what you've read holds
true, then I guess there is no real difference between the two.
Set
> >1) Is bill.service_id selective? I.e. does there only exist one or a fewThat depends upon the plan of your query. If bill is not the first table of
> >rows in the table with each value? If not, this field should not be indexed.
>
>Actually bill.service_id is not very selective. Do you think there will be
>some
>performance gain if I delete the index on bill.service_id?
your plan and you do have an index for bill.account_id that is selective,
then yes, I think performance would improve.
> >2) Why do you use "not exists (select * from tbl_invalid inv whereI've never read that... just assumed that the less you were selecting the
> >inv.party_id = pty.party_id)"? Change it to "not exists (select 1 from
> >tbl_invalid inv where inv.party_id = pty.party_id)".
>
>I read somewhere that using "select * ..." in cases like this is
>faster, but I will try "select 1 ..." as well.
better. And what is less than a constant number? If what you've read holds
true, then I guess there is no real difference between the two.
Set