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

Joe McDonnell commented on IMPALA-5200:
---------------------------------------

This issue is something I encountered recently when looking at the total time 
values in our runtime profiles. One way to fix this is to implement a special 
Counter for time that has the start time field embedded. This moves the start 
time from a stack variable to one that is accessible to other threads. The 
start time would be zero (or some otherĀ invalid value) whenever the thread is 
not in a wait. The value() function would look something like this:
{code:java}
int64_t value() {
  int64_t ret_value = value_;
  int64_t start_time = start_time_
  if (start_time != 0) {
    cur_time = GetCurrentTimeMicros();
    ret_value += (cur_time - start_time);
  }
  return ret_value;
}{code}
This requires time calls on accessing the value, butĀ it makes the counter 
smooth. The other downside is that there is a timing window when the updating 
thread comes out of the wait and is in the process of updating the counter. An 
external reader at this point could undercount.

> Profile timers not updated during long-running sort
> ---------------------------------------------------
>
>                 Key: IMPALA-5200
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5200
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>    Affects Versions: Impala 2.9.0
>            Reporter: Tim Armstrong
>            Priority: Minor
>              Labels: observability, ramp-up, supportability
>
> If you have a query plan with a long-running sort operation (e.g. minutes), 
> the profile timers are not updated to reflect the time spent in the sort 
> until the sort starts returning rows.
> E.g. this is a summary from a sort query that was running for a few hours 
> (!). The summary was misleading and the "heat map" plan in the debug web UI 
> is misleading - it showed the join as the "hot" operator. It would be ideal 
> if we could somehow at least periodically update the time spent in the 
> operator.
> {code}
> Operator              #Hosts   Avg Time   Max Time    #Rows  Est. #Rows   
> Peak Mem  Est. Peak Mem  Detail                   
> ----------------------------------------------------------------------------------------------------------------------------
> 05:MERGING-EXCHANGE        1    0.000ns    0.000ns        0     635.58M       
>    0        -1.00 B  UNPARTITIONED            
> 03:SORT                    1    0.000ns    0.000ns        0     635.58M   
> 47.86 GB      800.00 MB                           
> 02:HASH JOIN               1    4s859ms    4s859ms  771.02M     635.58M  
> 162.11 MB       16.03 MB  INNER JOIN, BROADCAST    
> |--04:EXCHANGE             1   38.988ms   38.988ms  247.20K     247.20K       
>    0              0  BROADCAST                
> |  01:SCAN HDFS            1    8s089ms    8s089ms  247.20K     247.20K    
> 3.79 MB       32.00 MB  product b     
> 00:SCAN HDFS               1  209.997ms  209.997ms   15.09M     635.58M  
> 185.27 MB      176.00 MB  sales a
> {code}
> http://community.cloudera.com/t5/Interactive-Short-cycle-SQL/Impala-join-query-running-slow



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to