How to download CSV without rerunning query

Every time I download a .CSV in Data Grip, the query has to re-run.  Is there anyway to prevent this from happening?  I've never used a SQL client that had to rerun each query in order to download.

5 comments

Hello Andrew,

Can you please describe how do you import the results?

Note that Results tab in the Database Tool Window could be showing only a portion of select (if query results are too big), but when you are exporting the results in a file DataGrip will select all the remaining rows. The portion of the result which is being selected is configured in prefetched size option in File | Settings | Database | Data Views settings.

Does it help?

0

I have this problem too. 

If I have a query that takes some time to construct and run, yes it does only show the first ~500 rows or so. 

Then if I click export to csv, it re runs the query (taking the time) and then exports it to file. 

When the queries use variables set prior to the main query, it is particularly annoying, as the variables may no longer be set by the time I re run the query. 

Generally I find the interface is hard to use and understand the status (executing or not) if you are running long running queries, across different databases. 

0

If you select your query and right-click, you can choose Execute to File

5

Has anyone found a solution to this? I used to be able to export results easily, but long queries are now re-running upon selecting export results. 

0

+1 have the same issue. How do you download results to file without re-running the query?

0

Please sign in to leave a comment.