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

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

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

    https://github.com/apache/incubator-trafodion/pull/766#discussion_r84124281
  
    --- Diff: core/sql/optimizer/opt.cpp ---
    @@ -5034,6 +5029,20 @@ void OptDefaults::initialize(RelExpr* rootExpr)
          preFetchHistograms_           = FALSE;
       }
     
    +  // Find out what the RMS security key invalidation garbage collection
    +  // interval is (this mirrors the logic in runtimestats/ssmpipc.cpp), so
    +  // we can fail-safe the histogram cache.
    +
    +  char *sct = getenv("RMS_SIK_GC_INTERVAL_SECONDS");  // in seconds
    +  if (sct)
    +    {
    +      siKeyGCinterval_ = ((Int64) str_atoi(sct, str_len(sct)));
    +      if (siKeyGCinterval_ < 10)
    +        siKeyGCinterval_ = 10;
    +    }
    +  else
    +    siKeyGCinterval_ = (Int64)24 * 60 * 60; // 24 hours
    +
    --- End diff --
    
    The sik key interval is being stored as a class member.  Could someone 
change the envvar between the time you set the variable and the time it is 
used?  Would it be better to calculate it on the fly?


> Optimizer histogram cache is sometimes never refreshed
> ------------------------------------------------------
>
>                 Key: TRAFODION-2282
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2282
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 2.1-incubating
>         Environment: All
>            Reporter: David Wayne Birdsall
>            Assignee: David Wayne Birdsall
>             Fix For: 2.1-incubating
>
>
> Here's the scenario:
> In session 1, create a table T1 and populate it with, say, 200000 or more 
> rows.
> In session 2, prepare a query that selects from T1. For example, select 
> A,COUNT(*) FROM T1 GROUP BY A. The query should compile fine, but you should 
> see missing statistics warning messages (warning codes 6007 and 6008).
> In session 1, do "update statistics for table t1 on every column"
> In session 2, prepare other queries over a period of time. What should happen 
> is that after about an hour, the Optimizer decides to refresh the histograms. 
> However, due to a bug, it might never do so. So, the missing statistics 
> warnings (6007, 6008) never go away. Worse, the prepares never benefit from 
> the statistics so plan choice may be poor.



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

Reply via email to