sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.59k stars 724 forks source link

Feature: Enable Pagination for all queries #714

Closed sschmachtel closed 6 months ago

sschmachtel commented 7 months ago

The Browsing of tables does already have pagination, which works reasonably well for big tables (10GB+). However we are providing the interface to people who are not 100% sql fluent in read only mode. So when they build a query that has a huge result set (for example select * from $this_big_table), they manage to kill every Server we can provide within a reasonable price range (a few gb ram). It would be fantastic if one can either enable pagination for queries as well (maybe a config option?) or to have a paginated result set by default (as phpmyadmin does have this).

sosedoff commented 6 months ago

I've had a first hand experience with "SELECT * ..." queries myself, and not gonna lie, i basically had to either kill the process or reload the page and stop the query in UI.

Haven't used phpMyAdmin in ages so can't really comment on that (or if their UI/UX is even applicable to Pgweb), but i think it would be cool to have a smart-ish pagination for custom queries. For simple queries it would be fairly easy to implement, but i'm not sure about more complex ones. Do you have any suggestions or ideas on how it could be implemented for Postgres?

sosedoff commented 6 months ago

Im gonna close for now. If anyone has good ideas or PRs we can always reopen.