crate-admin icon indicating copy to clipboard operation
crate-admin copied to clipboard

Add a button in the console to cancel the currently running query

Open hlcianfagna opened this issue 2 years ago • 3 comments

While it is possible to open a separate browser tab, query sys.jobs and issue a kill command, it would be really handy to have a button directly in the console to cancel the currently running query.

Related with https://github.com/crate/crate-admin/issues/675

hlcianfagna avatar Mar 31 '23 07:03 hlcianfagna

Any tip on how to easily reproduce a long timed query to develop/test this?

surister avatar Oct 04 '23 19:10 surister

Dear @surister,

It looks like CrateDB does not implement pg_sleep. However, @proddata referenced a sleep function over at https://github.com/crate/crate/issues/14511.

SELECT sleep(6000);

On the other hand, I can't find a corresponding definition anywhere. It is probably defined per user defined function ^1, i.e. written in JavaScript?

With kind regards, Andreas.

amotl avatar Oct 04 '23 23:10 amotl

Hi, UDFs are a particular case when it comes to terminating queries I think, but you can simply run a large INSERT INTO like:

CREATE TABLE tbl1 (a text);

INSERT INTO tbl1 
SELECT a.b::text 
FROM generate_series(1,100000000) a(b);

hlcianfagna avatar Oct 05 '23 09:10 hlcianfagna