[ 
https://issues.apache.org/jira/browse/TRAFODION-1449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14700102#comment-14700102
 ] 

Qifan Chen commented on TRAFODION-1449:
---------------------------------------

The problem appears with the inclusion of the selection predicate as part of 
exePreds at line 166 in method processConstHBaseKeys(). 

Here are the details. 

Code @ 166 adds RANGE SPEC (Vid 25)  back to the key predicates {21, 23} which 
are derived from the same RANGE SPEC during the construction of skey!


  21: (VEGRef_10((TRAFODION.SEABASE.FOO.UNIQ)) > 2)
  23: (VEGRef_10((TRAFODION.SEABASE.FOO.UNIQ)) < 5)
  25: (VEGRef_10((TRAFODION.SEABASE.FOO.UNIQ)) Range in 
(VEGRef_10((TRAFODION.SEABASE.FOO.UNIQ)) > 2) and 
(VEGRef_10((TRAFODION.SEABASE.FOO.UNIQ)) < 5))


When processing this range spec of Vid 25, a new set of predicates {30, 32} are 
added.

  30: (VEGRef_10((TRAFODION.SEABASE.FOO.UNIQ)) > 2)
  32: (VEGRef_10((TRAFODION.SEABASE.FOO.UNIQ)) < 5)

So the entire set of key predicates become {21, 23, 30, 32}. 

In KeyColumns::KeyColumn::insert()@2330,  predicates {21, 23} are perfectly 
assigned to the column UNIQ.  When processing predicate 30, a state of CONFLICT 
is detected. Note that there is no redundancy check in the code, because 
predicate(21) == predicate (30). 

When the column is assigned a CONFLICT state, we stop assign the end key. 


> End-key is not specified for a scan node when range spec feature is on. 
> ------------------------------------------------------------------------
>
>                 Key: TRAFODION-1449
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-1449
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 1.1 (pre-incubation)
>            Reporter: Qifan Chen
>            Assignee: Qifan Chen
>              Labels: performance
>
> Problem: the end key is not specified for the scan operator and is evaluated 
> in the executor predicate. 
> MODULE_NAME .............. DYNAMICALLY COMPILED
> STATEMENT_NAME ........... XX
> PLAN_ID .................. 212306167959521210
> ROWS_OUT ................. 1
> EST_TOTAL_COST ........... 0.01
> STATEMENT ................ select *
>                            from foo << + cardinality 10e8 >>
>                            where uniq > 2 and uniq < 5;
> TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
> TABLE_NAME ............... FOO
> REQUESTS_IN .............. 1
> ROWS_OUT ................ 11
> EST_OPER_COST ............ 0.01
> EST_TOTAL_COST ........... 0.01
> DESCRIPTION
>   max_card_est .......... 11
>   fragment_id ............ 0
>   parent_frag ............ (none)
>   fragment_type .......... master
>   scan_type .............. subset scan of table TRAFODION.SEABASE.FOO
>   object_type ............ Trafodion
>   columns ................ all
>   begin_keys(excl) ....... 2
>   end_keys(incl)
>   cache_size ........... 100
>   probes ................. 1
>   rows_accessed ......... 11
>   key_columns ............ UNIQ
>   executor_predicates .... (UNIQ < 5) and (UNIQ > 2) and (UNIQ < 5)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to