20

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.

Andhi Irawan
  • 456
  • 8
  • 15
annunarcist
  • 1,637
  • 3
  • 20
  • 42

1 Answers1

25

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.

Phil
  • 674
  • 7
  • 14