From: Dmitry Y. (JIRA) <tr...@fi...> - 2008-08-25 06:20:19
|
Computed expressions may be optimized badly if used inside the RETURNING clause of the INSERT statement ------------------------------------------------------------------------------------------------------- Key: CORE-2053 URL: http://tracker.firebirdsql.org/browse/CORE-2053 Project: Firebird Core Issue Type: Bug Components: Engine Affects Versions: 2.1.1, 2.5 Alpha 1, 2.1.0 Reporter: Dmitry Yemanov 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 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |