datafuselabs / databend

๐——๐—ฎ๐˜๐—ฎ, ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€ & ๐—”๐—œ. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.29k stars 701 forks source link

feat: support adjust query's priority #15352

Closed dqhl76 closed 1 week ago

dqhl76 commented 2 weeks ago

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Tracking on: https://github.com/datafuselabs/databend/issues/15462

feat: support adjust query's priority

support dynamic adjust query's priority

How to use

SET PRIORITY (HIGH | MEDIUM | LOW) <session_id>

can get session_id from show processlist;

Test

send two same query: select avg(number) from numbers(10000000000);

root@localhost:8000/default> set priority high '39c01f8f-6c14-40bc-a1f8-1d24e9cd4a75';
root@localhost:8000/default> set priority low '7575b113-ce11-474f-b97a-292f0bb57c42';

39c01f8f-6c14-40bc-a1f8-1d24e9cd4a75

root@localhost:8000/default> select avg(number) from numbers(10000000000);
1 row read in 102.907 sec. Processed 10 billion row, 74.51 GiB (97.18 million row/s, 741.39 MiB/s)

7575b113-ce11-474f-b97a-292f0bb57c42

root@localhost:8000/default> select avg(number) from numbers(10000000000);
1 row read in 135.393 sec. Processed 10 billion row, 74.51 GiB (73.86 million row/s, 563.50 MiB/s)

Tests

Type of change


This change isโ€‚Reviewable