trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.44k stars 3.01k forks source link

Regex based Query text selection in selector groups #18926

Open Rogers750 opened 1 year ago

Rogers750 commented 1 year ago

Generally, For connection queries like Select Version(), Select 1, I want to create a separate resource group. These are very small queries and they got stuck as other queries in the same resource group are occupying all the resources. I was trying a lot to find a way so that only "select version ()" queries run for a particular resource group and I never see connection not established error on my source side. But I got to know that there is no way around this. So raising this ticket.

I thing it will make the Resource Groups utility more richer if can introduce this. Thanks :)

willmostly commented 1 year ago
sajjoseph commented 1 year ago

Technically there is one another way to handle it. If there is a way to intercept the incoming request before it reaches the coordinator (say using a proxy server), you could inspect the queries and set the client tag to some value (example: health_check_queries) and then use that client tag in resource group to route the queries to a group that is different from regular queries.

That being said, having this ability natively in resource group will be ideal.