Subject | Re: [firebird-support] Slow query |
---|---|
Author | Arno Brinkman |
Post date | 2004-08-05T21:11:15Z |
Hi,
conjunctions for determing join order. The only way is working around it,
but because you've a view it becomes more difficult and can effect other
queries.
Workaround is creating VIEW as :
SELECT
<fields>
FROM
Pets p
JOIN Owners o ON (o.OwnerID = p.OwnerID + 0)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
> I have the following slow query(PETNAMEONLY,OWNERNUM4)))
> SELECT * FROM PSearch WHERE PetName like 'JETHRO%' Order by
> PetName,OwnerLName
> firebird comes up with this plan for it
> PLAN SORT (JOIN (PSEARCH O NATURAL,PSEARCH P INDEX
> this plan has an execution time of 00:00:00.0651 with a prepare time of<snip>
> 00:00:00:0010 according to ibconsole,
> however if I specify the following plan
> PLAN JOIN (PSEARCH P INDEX (PETNAMEONLY),PSEARCH O INDEX (OWNERIDOWNERS))
> the plan has an execution time of 00:00:00.0010 and a prepare time of
> 00:00:00:0000.
> PSearch is a view which is described as follows<snip>
> select
> from Pets p join Owners o on o.OwnerID = p.OwnerIDThe problem here is that FB doesn't use STARTING WITH and IS NULL
>
> rebuilding indexes has no effect, and index selectivity is recalculated
> twice a day.
> is my only solution to keep specifying the plan whenever this query
> comes up? I would love to have some insight as to this query.
conjunctions for determing join order. The only way is working around it,
but because you've a view it becomes more difficult and can effect other
queries.
Workaround is creating VIEW as :
SELECT
<fields>
FROM
Pets p
JOIN Owners o ON (o.OwnerID = p.OwnerID + 0)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://80.126.130.81