sosedoff / pgweb

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

Add button to toggle auto-completion in the SQL editor and corresponding configuration option #562

Closed mjf closed 1 year ago

mjf commented 2 years ago

When connected to Postgres database with hundreds of thousands of tables or with highly complex structures the auto-completion in the SQL editor makes editing real pain because of editor lags for several seconds due to the generation of the auto-completion lists (I guess). Could you please add a switch to turn the auto-completion on/off and an configuration option for it's default setting (on/off)? Thank you.


Further proposals: Also, what's somewhat related is that the initial loading of the database structure (in the left pane) blocks the WUI. It would be nice if this was somewhat asynchronous, just indicating somehow that it's not completely loaded yet and progressing to show what's already scanned but in a way it does not block the rest of the WUI (so that one could connect and start typing SQL immeditately without the need to wait until the left pane loads completely). Thank you.

sosedoff commented 2 years ago

When you say hundreds of thousands of tables what do you mean by that? Does your server have many schemas with a lot of tables in them or all in one schema?

mjf commented 2 years ago

@sosedoff Sorry for the delay.

Many tables per schema (normalized database; TimescaleDB with Promscale ingesting Telegraf measures via Prometheus remote write protocol or something similar to this could be a good example).

sosedoff commented 1 year ago

I think this edge case is just way off the general usage of this tool, e.g if you have a huge data set and lots of objects, it would probably be better to use something else. I don't know enough about other DB UI products and how they stack up in that regard, but i have a feeling there might be the same exact issue. I suggest you implement the change in your own fork.