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

ASF GitHub Bot commented on FLINK-8144:
---------------------------------------

Github user dianfu commented on the issue:

    https://github.com/apache/flink/pull/5063
  
    @fhueske  Yes, the bad performance is related to the way we generate the 
watermarks. But this is the way how punctuated watermark works. If we do not 
optimize for punctuated watermark, then are we suggesting users not to use 
punctuated watermark for unbounded over window?
    
    For the side effect `By registering timers on different timestamps, we have 
many timers that all will fire when a watermark is received.`, I think we can 
add a variable such as `lastProcessedWatermark` to record the last processed 
watermark. Then there will be no much overhead. Thoughts?


> Optimize the timer logic in RowTimeUnboundedOver
> ------------------------------------------------
>
>                 Key: FLINK-8144
>                 URL: https://issues.apache.org/jira/browse/FLINK-8144
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API & SQL
>            Reporter: Dian Fu
>            Assignee: Dian Fu
>             Fix For: 1.5.0
>
>
> Currently the logic of {{RowTimeUnboundedOver}} is as follows:
> 1) When element comes, buffer it in MapState and and register a timer at 
> {{current watermark + 1}}
> 2) When event timer triggered, scan the MapState and find the elements below 
> the current watermark and process it. If there are remaining elements to 
> process, register a new timer at {{current watermark + 1}}.
> Let's assume that watermark comes about 5 seconds later than the event on 
> average, then we will scan about 5000 times the MapState before actually 
> processing the events.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to