Subject | Re: [firebird-support] Joins, left joins, and plans |
---|---|
Author | Dmitry Yemanov |
Post date | 2005-10-11T18:52:13Z |
"Rick Debay"" <rdebay@...> wrote in message:
JOIN (B2C INDEX (FK_B2C_B), C INDEX (PK_C)))
Tested with v2.0. So you're correct, just the v1.5 optimizer is not so good
to follow your thinking :-)
Dmitry
>Same here.
> SELECT
> *
> FROM
> A JOIN A2B ON A.ID = A2B.A
> JOIN B ON B.ID = A2B.B
> LEFT JOIN B2C ON B.ID = B2C.B
> LEFT JOIN C ON C.ID = B2C.C
>
> PLAN JOIN (JOIN (JOIN (B NATURAL,A2B INDEX (FK_A2B_B),A INDEX
> (PK_A)),B2C INDEX (FK_B2C_B)),C INDEX (PK_C))
> SELECTPLAN JOIN (JOIN (B NATURAL, A2B INDEX (FK_A2B_B), A INDEX (PK_A)),
> *
> FROM
> A JOIN A2B ON A.ID = A2B.A
> JOIN B ON B.ID = A2B.B
> LEFT JOIN (
> B2C JOIN C ON C.ID = B2C.C
> ) ON B.ID = B2C.B
>
> PLAN JOIN (JOIN (B NATURAL,A2B INDEX (FK_A2B_B),A INDEX (PK_A)),JOIN (C
> NATURAL,B2C INDEX (PK_B2C)))
JOIN (B2C INDEX (FK_B2C_B), C INDEX (PK_C)))
Tested with v2.0. So you're correct, just the v1.5 optimizer is not so good
to follow your thinking :-)
Dmitry