Subject RE: [firebird-support] Query tuning help
Author C Fraser
That's the ticket!!

>> I guess Status has a very low selectivity, but have you tried this
one (on FB1.5):

Yes, Status has a low selectivity.

>> WHERE
>> (Table4.ForeignKey1 = 170) and
>> ( ((Table1.ForeignKey2 = 962) and (Table1.Status = 8)) or
>> ((Table1.ForeignKey2 = 963) and (Table1.Status = 8)))

Just tried it now, and it is much faster. Also tried it back on FB 1 and
it also is much faster (returns in a few seconds rather than hours).

Is there any guide line on how you should structure these queries since
they produce drastically different performance results? Or do you just
keep on mucking with it until you find something that works (or works
fast enough?).

Regards
Colin



-----Original Message-----
From: Arno Brinkman [mailto:firebird@...]
Sent: Tuesday, 29 July 2003 8:43 p.m.
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Query tuning help


Hi,

> The testing of this query was running against a Firebird 1.0 server.
>
> Preparing the query against a Firebird 1.0.3 server produces the same
> plan (I have not tried running it, as I don't want to slow down our
> live server).

Maybe you could post some metadata and the PLAN.

> Interestingly enough, running it against our FB 1.5 RC 4 test server
> produces various results as follows:

I guess Status has a very low selectivity, but have you tried this one
(on
FB1.5):

WHERE
(Table4.ForeignKey1 = 170) and
( ((Table1.ForeignKey2 = 962) and (Table1.Status = 8)) or
((Table1.ForeignKey2 = 963) and (Table1.Status = 8)))


Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/


Nederlandse firebird nieuwsgroep :
news://80.126.130.81






To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/



######################################################################
Attention:
The information in this email and in any attachments is confidential.
If you are not the intended recipient then please do not distribute,
copy or use this information. Please notify us immediately by return
email and then delete the message from your computer.
Any views or opinions presented are solely those of the author.
######################################################################