Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I limit DBeaver Data Editor to limit result set size?

How can I limit DBeaver Data Editor to limit the result set size?

I know the default is 200 and we can configure it in settings/preferences for the "Data Editor" section but this filter seems to be applied after all the results are already fetched from remote DataBase to local.

enter image description here

How can I limit this 200 before sending the request to the Database itself?

Meaning, instead of issuing a "Select * from..." to the Databases and doing the 200 results set a filter on local, I want to configure DBeaver to send "Select * from... LIMIT 200" to remote DB.

like image 201
annunarcist Avatar asked Nov 07 '19 22:11

annunarcist


People also ask

What is fetch size in DBeaver?

Re: max result-set size issue This configuration (result-set size) is actually "fetch size" - number of rows DBeaver fetches at one time. It doesn't limit maximum number of rows. If you need to limit max rows you have to use database specific functions in your queries (for instance LIMIT or ROWNUM).

How many rows can DBeaver handle?

There is a global fetch limit in DBeaver which stops fetching data after a certain amount of rows (I think the default is 200). When I scroll down, the next 200 rows are fetched, and so on. This is a great feature, but sometimes I want to fetch all rows at once (without using the export feature).

How do you check the size of a table in DBeaver?

Yes. Once upon a time there would be a ">" next to the word Tables and when I clicked it, all the tables would show with their size in mb next to them.

Where is preferences in DBeaver?

To change the data format settings use the option Window -> Preferences in main menu. In the Preferences dialog box go to Editors -> Data Editor -> Data Formats.


1 Answers

By checking the "Use SQL to limit fetch size" check box you should get the effect you want.

enter image description here

You can verify dBeaver is behaving the way you expect by taking a look at the query in the dBeaver execution log. You will see "LIMIT" has been appended to your query.

enter image description here

https://github.com/dbeaver/dbeaver/wiki/SQL-Editor#results-panel

It's probably worth noting that you may also want to consider de-selecting the "Refresh data on next page reading" option or the "Auto-fetch next segment" option if you want to guarantee LIMIT is always selecting the set amount of rows. With both of these options turned on in addition to "Use SQL to limit fetch size", dBeaver will rerun the full result set as you scroll through your data and pass the last row. For example, when you execute the query the first time it will run with "LIMIT 0, 200", returning the first two hundred rows. When you scroll past row 200, a new query will be executed, with "LIMIT 0, 400". When you pass row 400 a new query will be run with "LIMIT 0, 600" and so on.

like image 79
Phil Avatar answered Oct 14 '22 06:10

Phil