Skip to content

fix(postgres): browse on read-only; page with ORDER BY PK; do not block on COUNT(*) - #859

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/788-postgres-browse-order
Sep 20, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/788-postgres-browse-order

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • Browse stays on PgSessionMode.readOnly. Save / REFRESH stay on tableWrite.
  • Table Browser SELECT uses ORDER BY primary-key columns when a PK exists (schema is loaded before the page query).
  • First paint uses pg_class.reltuples instead of blocking COUNT(*). Stale estimates below the current page are ignored so Next still works.

Test plan

  • Open a table with a PK — browse SQL has ORDER BY those columns; paging is stable.
  • Open a large table — first paint does not wait on COUNT(*); Next works when the page is full even if reltuples is stale/low.
  • Views / no PK omit ORDER BY. Save / REFRESH still use tableWrite.

Closes #788

Browse stays read-only. Row totals use reltuples so a sequential COUNT
cannot forceClose the pooled socket. Stale estimates below the page
leave Next enabled.
@github-actions github-actions Bot added bug Something isn't working performance Theme parser epic label: performance data-grid Interactive data grid, cell editor, filtering, groupings backend Backend database driver execution and queries labels Sep 20, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 5b1a317 into dev Sep 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend database driver execution and queries bug Something isn't working data-grid Interactive data grid, cell editor, filtering, groupings performance Theme parser epic label: performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant