You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/01/27 03:54:00 UTC

[jira] [Commented] (IMPALA-7969) Always admit trivial queries immediately

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

ASF subversion and git services commented on IMPALA-7969:
---------------------------------------------------------

Commit b3e9c4a65fa63da6f373c9ecec41fe4247e5e7d8 in impala's branch refs/heads/master from Yida Wu
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=b3e9c4a65 ]

IMPALA-7969: Always admit trivial queries immediately

The idea of trivial query is to allow certain queries to bypass the
admission control, and therefore accelerating the query execution
even when the server resource is at capacity. It could benefit
the queries that require a fast response while consuming the
minimum resources.

This patch adds support for the trivial query detection and allows
an immediate admission for the trivial query. We define the trivial
query as a subset of the coordinator-only query, and returns no more
than one row. The definition is as below:
  - Must have PLAN ROOT SINK as the root
  - Can contain UNION and EMPTYSET nodes only
  - Results can not be over one row

Examples of a trivial query:
  - select 1;
  - select * from table limit 0;
  - select * from table limit 0 union all select 1;
  - select 1, (2 + 3);

Also, we restrict the parallelism of execution of the trivial
query, each resource pool can execute no more than three trivial
queries at the same time. If the maximum parallelism is reached,
the admission controller would try to admit the trivial query
via normal process. More precisely, if the cluster is running with
a global admission controller, the max parallelism for the trivial
query is three per resource pool, but if there is no global
admission controller, each coordinator would admit the trivial
queries based on its own local variable, therefore, the max
parallelism would be three per coordinator per resource pool in
this case.

As the first patch, we try to keep the trivial query as simple as
possible, and it could be extended in future.

Added query option enable_trivial_query_for_admission to control
whether the trivial query policy is enabled.

Tests:
Passed exhaustive tests.
Added test_trivial_query and test_trivial_query_low_mem.

Change-Id: I2a729764e3055d7eb11900c96c82ff53eb261f91
Reviewed-on: http://gerrit.cloudera.org:8080/19214
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Always admit trivial queries immediately
> ----------------------------------------
>
>                 Key: IMPALA-7969
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7969
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>            Reporter: Tim Armstrong
>            Assignee: Yida Wu
>            Priority: Major
>              Labels: admission-control
>
> Here are two common query types that consume minimal resources:
> * {{select ... from ... limit 0}}, which is used by some clients to determine column types
> * {{select <expr1>, <expr2>, <expr3>}}, which just evaluates some constant expressions on the coordinator
> Currently these queries get queued if there are existing queued queries or the number of queries limit is exceeded, which is inconvenient for use cases where latency is important. I think the planner should identify trivial queries and admission controller should admit immediately.
> Here's an initial thought on the definition of a trivial query:
> * Must have PLAN ROOT SINK as the root
> * Can contain UNION and EMPTYSET nodes only



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org