Subject AW: [firebird-support] Re: Any available documentation on Plan Analyzer?
Author Steffen Heil
Hi

Have 3 tables:
A ( X, Y )
with 1000 records with Y = 1
B ( Y, Z )
with 1000 records with Y = 1 (and only one of those with Z = 1)
C ( Z )
with 1 record with Z = 1

Indices are of no matter.

Now,
A JOIN B has 1000000 records.
(A JOIN B) JOIN C has 1000 records.
B JOIN C has 1 record.
A JOIN (B JOIN C) has 1000 records.

So you get the same result for:
A JOIN (B JOIN C) and (A JOIN B) JOIN C

But the intermediate result has 10^6 as many records.

The order of JOIN expressions determins assoiciativity (in my example the
parenthesis).

Regards,
Steffen



> -----Ursprüngliche Nachricht-----
> Von: Svein Erling Tysvær
> [mailto:svein.erling.tysvaer@...]
> Gesendet: Samstag, 5. Februar 2005 20:48
> An: firebird-support@yahoogroups.com
> Betreff: [firebird-support] Re: Any available documentation
> on Plan Analyzer?
>
>
>
> Hi Adam!
>
> > I reduced a query from 3 minutes to about 0.5 seconds just
> last week,
> > and all I did was switch around the order of the joins and the
> > switched one of them with the from. It reduced the workload from
> > 100000 records to about 3 or 4 records.
>
> Statements like this makes me curious. Are you saying that
> SELECT * FROM A JOIN B is different from SELECT * FROM B JOIN
> A? Can you show us the "good" and "bad" query with their
> indexes? I'm just puzzled.
>
> Set
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


[Non-text portions of this message have been removed]