How to run multiple concurrent queries in the same console?

I frequently have to run a bunch of SQLs from the same file, some of which can be run in parallel. How do I do that in DataGrip?

It seems that within the same console, queries are queued up. A 1-second query submitted after a 100-second query waits for it to complete. I want the 1-second query to finish first (same as pressing Ctrl+\ in DBeaver). I'm not talking here about showing a result tab per query (I already enabled that).

I don't care about the console on which each query executes. Is there maybe a way to submit a query from one file to a different console without having to copy/paste?

Thanks a bunch!

7
8 comments
Avatar
Christian Mladenov

Hi Vasily,

Thanks for the response, but I am not sure we are on the same page. I already have all the queries that I want to run (and a ton more) in one file. I want to run a subset of the queries in the file, and I want to run them concurrently. I don't want to run all the queries in the file, I don't want to run queries sequentially, and I don't want to create a new files every time I need to run a few queries.

I guess DataGrip is built more for ETL type work where you run a file end-to-end, and for developing individual queries. For the former we use Airflow as some of our ETL queries take hours.

Let me give you an example: I am developing an analysis where I read data form an aggregate events table into 20 different single-event tables based on different filtering conditions. Each "update" takes 5 minutes, and I want to run all of them concurrently in 5 minutes, rather than waiting close to 2 hours. Yes I could split each query into a separate file, but messing with 20 files is a hassle.

5

Yes please, as someone coming from SQL Server Management Studio background I find the lack of this feature quite unpleasant. Still having a hard time to get used to DataGrip/IntelliJ just because of this issue.

3

Hi,
There is an issue https://youtrack.jetbrains.com/issue/DBE-5691 based on your description.
Thank you.

2

As a temporary workaround, you can run queries from another console (when query is finished you'll be notified)

 

1
Avatar
Christian Mladenov

In case it makes a difference - I'm using Redshift. Tried both the Redshift & Postgres JDBC drivers.

0

Yes please, as someone coming from SQL Server Management Studio background I find the lack of this feature quite unpleasant. Still having a hard time to get used to DataGrip/IntelliJ just because of this issue.

0

Yes please, as someone coming from SQL Server Management Studio background I find the lack of this feature quite unpleasant. Still having a hard time to get used to DataGrip/IntelliJ just because of this issue.

 
0

Hi,

As a workaround, you should place all queries in one SQL file and execute it from Files tree.

Thank you.

-5

Please sign in to leave a comment.