Subject | Re: [firebird-support] Major query performance problems |
---|---|
Author | Ann W. Harrison |
Post date | 2010-12-08T17:05:29Z |
On 12/8/2010 1:13 AM, PenWin wrote:
Firebird optimizer.
What your seeing is not normal.
tables is turned into an inner join.
Good luck,
Ann
>The order of tables in an inner join is not significant to the
> First thing I would try, _especially_ since you use inner joins, would
> be changing the order of the tables: Instead of
> SELECT a.id, b.id FROM a JOIN b WHERE ...
> try
> SELECT a.id, b.id FROM b JOIN a WHERE ...
Firebird optimizer.
>You really ought to look at the plans and the index statistics.
> Second thing, it's been my experience that inner joins tend to be much
> slower than outer joins with Firebird (probably a problem with my
> optimizations, but the end result is that I am getting much better
> performance from SELECT a.id, b.id FROM a LEFT JOIN b WHERE ... than
> from SELECT a.id, b.id FROM a JOIN b WHERE ...
What your seeing is not normal.
>My recollection is that an outer join with conditions on both
> It seems to me your query could be changed to an outer-join query
> without changing results:
>
> SELECT FIRST 1000 PHYSICAL_COPY."ID" AS COL0
> FROM COPY
> JOIN PHYSICAL_COPY ON PHYSICAL_COPY."COPY_ID" = COPY."ID"
> WHERE (PHYSICAL_COPY."IS_MARKED_DELETED" = 1) AND (COPY."SOURCE_ID" =
> 'fb50a346-04e7-42d3-8782-1432001c74ad')
tables is turned into an inner join.
Good luck,
Ann