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

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: 19/Jan/16 06:05 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

Issue Links:

QA Status: Done successfully

 Description  « Hide
Test case:

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

select case when exists (select 1 from t1 where col1 = col2) then 1 else 0 end from t2;
-- PLAN (T1 INDEX (I1))
-- 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;
-- Full scan is chosen, this is a bug

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