Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tracked by #1
hlcianfagna opened this issue Mar 31, 2023 · 3 comments
Open
Tracked by #1

Comments

@hlcianfagna
Copy link
Contributor

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 #675

@surister
Copy link

surister commented Oct 4, 2023

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

@amotl
Copy link
Member

amotl commented Oct 4, 2023

Dear @surister,

It looks like CrateDB does not implement pg_sleep. However, @proddata referenced a sleep function over at crate/crate#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.

Footnotes

  1. https://cratedb.com/docs/crate/reference/en/5.4/general/user-defined-functions.html

@hlcianfagna
Copy link
Contributor Author

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants