If you will just close the HTTP connection with lasting query, the execution of that query is not stopped.
May be for DDL queries that bahaviour can be considered as acceptable, but for usual SELECTs - continuing the query execution after disconnect - is only wasting of server resources.
I know that there is replace_running_query and KILL QUERY but it not always possible (for example if client just died, and server have a lot of clients, and can't distinguish which are active and which - not) and requires some extra actions.
I think that for SELECTs you should check if connection is still active and kill / replace the query if connection was closed by the client / timeout, for DDLs / INSERTs - that behaviour probably should be configurable.
@filimonov , try using chproxy. It must kill the query immediately after the client closes http connection.
@filimonov , try using chproxy. It must kill the query immediately after the client closes http connection.
Using proxy is of course an option but it seems that much more users would benefit from the feature if it was implemented in the server itself.
Most helpful comment
Using proxy is of course an option but it seems that much more users would benefit from the feature if it was implemented in the server itself.