Konstantin Orlov created IGNITE-21047:
-----------------------------------------

             Summary: 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


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