Issue Details (XML | Word | Printable)

Key: CORE-2975
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Dmitry Yemanov
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Bad execution plan if some stream depends on multiple streams via a function

Created: 20/Apr/10 06:46 AM   Updated: 17/Dec/14 04:03 PM
Component/s: Engine
Affects Version/s: 2.0.0, 1.5.4, 2.0.1, 2.0.2, 2.0.3, 1.5.5, 2.1.0, 2.0.4, 2.5 Alpha 1, 2.1.1, 2.0.5, 2.1.2, 2.5 Beta 1, 2.5 Beta 2, 2.1.3, 1.5.6, 3.0 Initial, 2.5 RC1, 2.5 RC2
Fix Version/s: None

Issue Links:
Duplicate
 


 Description  « Hide
Test case:

create table T1 (ID int, COL int);
create index T1_ID on T1 (ID);
create unique index T1_COL on T1 (COL);

create table T2 (ID int);
create index T2_ID on T2 (ID);

create table T3 (ID int);
create index T3_ID on T3 (ID);


select *
from T1
join T2 on T2.ID = T1.ID
join T3 on T3.ID = coalesce(T1.ID, T2.ID)
where T1.COL = ?

-- bad plan by FB 1.5
-- PLAN JOIN (T3 NATURAL, T1 INDEX (T1_COL), T2 INDEX (T2_ID))

-- bad plan by FB 2.x
-- PLAN MERGE (SORT (JOIN (T1 INDEX (T1_COL), T2 INDEX (T2_ID))), SORT (T3 NATURAL))

-- expected plan
-- PLAN JOIN (T1 INDEX (T1_COL), T2 INDEX (T2_ID), T3 INDEX (T3_ID))


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.