query plan missing sort operator
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
Fix Committed
|
Medium
|
QF Chen |
Bug Description
the query plan generated for a load query that loads data from a table with primary key that has ascendant modifier into a table where the same key has descending modifiers does not add the sort operator and assume the data is already sorted correctly
this issue can be reproduced with below steps and it seems like an optimizer issue:
------
cqd comp_bool_226 'on';
set schema mytest2;
create table t_asc (a int not null, b int not null, primary key (a asc, b asc));
create table t_desc (a int not null, b int not null, primary key (a asc, b desc));
insert into t_asc values (1,1),(
insert into t_asc values (2,3);
prepare s from load transform into t_desc select * from t_asc;
explain options 'f' s;
execute s;
---------------
Changed in trafodion: | |
assignee: | nobody → taoufik ben abdellatif (taoufik-abdellatif) |
Changed in trafodion: | |
assignee: | taoufik ben abdellatif (taoufik-abdellatif) → QF Chen (qifan-chen) |
status: | New → In Progress |
Added the following logic in NJ::createConte xtForChild( ) to shut down plan 0, which does not require the left child of the NJ to sorted as the right child.
1. detect that it is a traf fast load query.
2. save the fact into NJ work space
3. shut down the right child of NJ for plan0