Description
The fix to JIRA TRAFODION-2765 unmasked another bug that causes regression test compGeneral/TEST006 to fail sometimes. The nature of the bug is that a query plan on a table with no statistics sometimes flips over to an MDAM plan where it wasn't before. One example of this that I saw happened in a release build while in a debug build the test passed.
The following script (sometimes!) reproduces the bug:
?section setup
create table t006t9 (a int not null primary key, b int, c int) salt using 2 partitions ;
create index t006t9ix1 on t006t9(b) ;
insert into t006t9 values (1,2,3), (10,20,30);
prepare expl from
select operator, cardinality,
cast(substring(description, position('scan_type: ' in description), position('object_type: ' in description) - position('scan_type: ' in description)) as char(100)) scan_type
from table(explain(null, 'S'))
where operator like '%SCAN%';
?section doit
prepare s from
select a,b from t006t9 <<+ index TRAFODION.SCH.T006T9IX1>> where b > 10;
execute expl;