Issue Details (XML | Word | Printable)

Key: CORE-2053
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Dmitry Yemanov
Votes: 0
Watchers: 0
Operations

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

Computed expressions may be optimized badly if used inside the RETURNING clause of the INSERT statement

Created: 25/Aug/08 03:08 AM   Updated: 26/Jan/09 08:28 AM
Component/s: Engine
Affects Version/s: 2.1.0, 2.5 Alpha 1, 2.1.1
Fix Version/s: 2.1.2, 2.5 Beta 1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
Test case:

create table t1 (col1 int);
create index i1 on t1 (col1);
commit;
insert into t1 (col1) values (1);
commit;
create table t2 (col2 int);
commit;

select case when exists (select 1 from t1 where col1 = col2) then 1 else 0 end from t2;
-- PLAN (T1 INDEX (I1))
-- PLAN (T2 NATURAL)
-- Everything is okay, T1 is accessed via an index

insert into t2 (col2) values (1) returning case when exists (select 1 from t1 where col1 = col2) then 1 else 0 end;
-- PLAN (T1 NATURAL)
-- Full scan is chosen, this is a bug


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