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

Maksim Zhuravkov commented on IGNITE-21047:
-------------------------------------------

1. It seems that there are only few places where such optimization can be 
applied w/o additional changes to other operators.
Changing ExecutionContext::execute to run in the caller thread a few times, 
before attempting to schedule cases, both NPEs and incorrect results when 
running SQL logic tests (sqllite/select with sub queries) - See attached patch.

2. Changing push to accept a batch of rows: most operators either pass-through 
(like project, that calls the next operator w/o any additional scheduling)
 or do batching prior to schedule a next run, meaning that some sort of 
batching is already in place.

> Sql. Avoid spamming execution tasks when possible
> -------------------------------------------------
>
>                 Key: IGNITE-21047
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21047
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Konstantin Orlov
>            Assignee: Maksim Zhuravkov
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>         Attachments: 
> IGNITE-21047__Sql__Avoid_spamming_execution_tasks_when_possible.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Need to revise all usages of 
> {{org.apache.ignite.internal.sql.engine.exec.ExecutionContext#execute}} and 
> check whether spawning a new task is legit in every particular case or it's 
> better to do the work right now.
> For example, lets take a look at 
> {{org.apache.ignite.internal.sql.engine.exec.rel.ScanNode#request}}: 
>     
> {code:java}
> @Override
>     public void request(int rowsCnt) throws Exception {
>         assert rowsCnt > 0 && requested == 0 : "rowsCnt=" + rowsCnt + ", 
> requested=" + requested;
>         checkState();
>         requested = rowsCnt;
>         if (!inLoop) {
>             context().execute(this::push, this::onError);
>         }
>     }
> {code}
> in case of the very first request we will spawn a new task, but it would be 
> better to drain the first batch of rows as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to