DaveBirdsall opened a new pull request #1856: [TRAFODION-3325] Pass down index 
hints for non-VEG equality predicates
URL: https://github.com/apache/trafodion/pull/1856
 
 
   The problem is that sometimes join equality predicates are not converted 
into VEGs, and therefore do not get pushed down to their children. That 
prevents Scan::addIndexInfo from considering indexes when there are column 
references in the join predicate. That can result in missed opportunities to 
use efficient index plans and instead doing full table scans + hash joins.
   
   My first attempt at fixing this problem was to generate an IS NOT NULL 
predicate for the children of such equality predicates, then attempt to push 
those down. This didn't work well: If the column was not nullable, logic in 
HBaseTable.java would try to optimize it out resulting in a null filter which 
resulted in an exception. Too, it also resulted in redundant predicates of the 
form <constant> = <constant> in explain plans for some queries.
   
   So, this fix takes a different approach. We add a member to RelExpr, 
possibleIndexColumns_, to contain the covered children of non-VEG equality 
predicates. We push down such children. At Scan::addIndexInfo, we consider such 
ValueIds when computing the set of indexes to try. That is, this fix creates an 
alternative mechanism to push down information to Scan::addIndexInfo, without 
generating possibly redundant predicates.
   
   An example of a join equality predicate that is not converted to a VEG is a 
join predicate involving a tuple list.
   
   I added a CQD, COMP_BOOL_194, which if set to 'OFF' turns off this fix. The 
default is 'ON'.
   
   When unit testing this fix, I noticed a bug in some of the optimizer 
debugging code that caused a core. I fixed that too (optimizer/opt.cpp).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to