Database Tool Window Pagination and Manual LIMIT Conflicts
19K reputation · 12 Sept 2023, 02:04 UTC
PHPStorm's Database tool window manages large datasets by applying a configurable Page Size, which automatically appends LIMIT and OFFSET clauses to the executed SQL to prevent JVM memory exhaustion.
A conflict arises when a developer writes a custom SQL query that already includes a hardcoded LIMIT clause to bound the initial result set. It is unclear how the IDE's internal pagination mechanism handles these pre-existing constraints when a user attempts to navigate to the next page of results.
Does the IDE's automatic pagination override the manual LIMIT clause in the query, or does it wrap the query as a subselect to apply the page offset? How does this behavior differ across database dialects that use varying pagination syntax?