Subject | Optimizer broken in FB 1.5.2 |
---|---|
Author | Pascalis |
Post date | 2004-11-15T12:45:12Z |
Hi All,
In the following example FB1.5.2 does not use index when joining simple
view.
CREATE TABLE TABLE_A (
A_ID INTEGER NOT NULL,
CONSTRAINT PK_TABLE_A PRIMARY KEY (A_ID)
);
CREATE TABLE TABLE_B (
B_ID INTEGER
);
CREATE VIEW VIEW_A AS
SELECT * FROM TABLE_A;
Whe the following query is executed :
select * from TABLE_B left join VIEW_A on A_ID = B_ID
The query plan for FB 1.5.2 RC1 (WI-V6.3.2.4634) and 1.5.2 RC2
(WI-V6.3.2.4671) is :
PLAN JOIN (TABLE_B NATURAL,VIEW_A TABLE_A NATURAL)
The query plan for FB 1.5.1 (WI-V6.3.1.4481) is correct :
PLAN JOIN (TABLE_B NATURAL,VIEW_A TABLE_A INDEX (PK_TABLE_A))
Both (1.5.2 and 1.5.1) use index when joining the tables :
select * from TABLE_B left join TABLE_A on A_ID = B_ID
Plan
PLAN JOIN (TABLE_B NATURAL,TABLE_A INDEX (PK_TABLE_A))
In the following example FB1.5.2 does not use index when joining simple
view.
CREATE TABLE TABLE_A (
A_ID INTEGER NOT NULL,
CONSTRAINT PK_TABLE_A PRIMARY KEY (A_ID)
);
CREATE TABLE TABLE_B (
B_ID INTEGER
);
CREATE VIEW VIEW_A AS
SELECT * FROM TABLE_A;
Whe the following query is executed :
select * from TABLE_B left join VIEW_A on A_ID = B_ID
The query plan for FB 1.5.2 RC1 (WI-V6.3.2.4634) and 1.5.2 RC2
(WI-V6.3.2.4671) is :
PLAN JOIN (TABLE_B NATURAL,VIEW_A TABLE_A NATURAL)
The query plan for FB 1.5.1 (WI-V6.3.1.4481) is correct :
PLAN JOIN (TABLE_B NATURAL,VIEW_A TABLE_A INDEX (PK_TABLE_A))
Both (1.5.2 and 1.5.1) use index when joining the tables :
select * from TABLE_B left join TABLE_A on A_ID = B_ID
Plan
PLAN JOIN (TABLE_B NATURAL,TABLE_A INDEX (PK_TABLE_A))