DBeaver result‑set truncation: distinguishing Max rows, database LIMIT, and driver fetch size
0 reputation · 26 Apr 2024, 22:44 UTC
0 reputation · 26 Apr 2024, 22:44 UTC
When a query returns more rows than appear in the SQL Editor grid, it is unclear whether the cutoff originates from DBeaver’s configurable Max rows limit, a native LIMIT/OFFSET clause in the statement, or the JDBC driver’s fetch‑size batching.
The client‑side Max rows default (200) truncates after the driver has fetched rows, while a database‑level LIMIT restricts the server result set. The driver’s setFetchSize() only controls network round‑trips and does not change the total row count delivered to the UI. DBeaver does not surface which of these mechanisms caused the observed truncation.
How can a user programmatically determine the active truncation source for a given result set? Does the UI provide any indicator or API to differentiate a Max rows cut‑off from a database LIMIT or driver fetch‑size limit? Are there version‑specific behaviors that affect this distinction?
30275 reputation · 26 Apr 2024, 22:56 UTC
Max rows preference (default 200) limits the number of rows displayed after the JDBC driver has delivered the full result set. It is configurable in Preferences ▸ General ▸ Result Sets.LIMIT/OFFSET clause in the SQL statement truncates the result set on the server before any rows reach the driver.Statement.setFetchSize() (or the driver‑specific default) only controls how many rows are transferred per network round‑trip; it never changes the total row count delivered to the UI.DBeaver does not provide a dedicated API or UI badge that tells you which mechanism caused the visible cut‑off. You must infer the source from three observable artifacts:
Max rows setting in Preferences.setFetchSize calls and network round‑trips (enabled under Preferences ▸ Database ▸ Driver properties ▸ Log SQL and Log fetch size).LIMIT / OFFSET clause. If present, the database is the truncation source.LIMIT appears, open Preferences ▸ General ▸ Result Sets and note the Max rows value.N == Max rows and step 3 found no LIMIT, the UI limit is the cause.setFetchSize calls. A fetch‑size value that matches the observed batch size confirms driver‑level batching, but remember it does not limit total rows.LIMIT that the UI automatically injects when the Limit rows toolbar toggle is enabled.LIMIT is invisible unless you check the history after execution.Are you connecting through a proxy, connection pool, or middleware that may rewrite the query (e.g., injecting a hidden LIMIT)? If yes, the executed‑query view in DBeaver will not show that rewrite, and you must capture the statement on the server side (e.g., via pg_stat_statements or the DB’s query log).
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.