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

ASF GitHub Bot commented on TRAFODION-27:
-----------------------------------------

Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/25#discussion_r34482687
  
    --- Diff: core/sql/generator/GenProbeCache.cpp ---
    @@ -361,6 +361,38 @@ short ProbeCache::codeGen(Generator *generator)
           // that there is room enough for one row.
         }
     
    +   double  memoryLimitPerCpu =
    +      
ActiveSchemaDB()->getDefaults().getAsLong(EXE_MEMORY_FOR_PROBE_CACHE_IN_MB) * 
1024 * 1024;
    +   double estimatedMemory;
    +   
    +   if (numInnerTuples_ > 0) {
    +      estimatedMemory = numInnerTuples_ * innerRecLength;
    +      if (estimatedMemory > memoryLimitPerCpu) {
    +          numInnerTuples_ = memoryLimitPerCpu / innerRecLength;
    +          queue_index pUpSize_calc;
    +          queue_index pDownSize_calc;                  
    + 
    +          pUpSize_calc = numInnerTuples_ * pUpSize / (pUpSize + pDownSize);
    +          pDownSize_calc = numInnerTuples_ * pDownSize / (pUpSize + 
pDownSize);
    +          queue_index pq2 = 1;
    +          queue_index bits = pUpSize_calc;
    +          while (bits && pq2 < pUpSize_calc) {
    +              bits = bits  >> 1;
    +              pq2 = pq2 << 1;
    +          }
    +          pUpSize = pq2;
    --- End diff --
    
    The code on lines 350-356 makes sure that numInnerTuples_ is greater or 
equal pUpSize. This while loop seems to me to be doing the opposite, make sure 
that pUpSize (and pDownSize) below are greater or equal numInnerTuples_. Should 
this say: pUpSize = pq2 / 2 instead?


> Time consuming compilation for queries of BLOB with JOINs 
> ----------------------------------------------------------
>
>                 Key: TRAFODION-27
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-27
>             Project: Apache Trafodion
>          Issue Type: Bug
>         Environment: Trafodion 1.2, HDP 2.2, CentOS 6
>            Reporter: Haifeng Li
>            Priority: Minor
>         Attachments: trafodion27_qry.sql, trafodion27_setup.sql
>
>
> It takes 3 ~ 5 seconds to compile a query that returns a BLOB field by 
> joining two tables. If a query is cached and subsequent queries are 'similar' 
> to
> the initial query, those subsequence compilation times will usually be
> much faster. However, sometimes we observe that subsequent queries with 
> literal difference still take long time in sqlci.



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

Reply via email to