You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Submitted by: @dyemanov
Is related to QA222
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
Commits: 6708d63 2bbcb54
The text was updated successfully, but these errors were encountered: