sasha-alias / sqltabs

Rich SQL client for Postgresql, MySQL, MS SQL, Amazon Redshift, Google Firebase (Firestore)
https://www.sqltabs.com
GNU General Public License v3.0
805 stars 65 forks source link

For each query execution a new connection is opened #152

Open willyrgf opened 3 years ago

willyrgf commented 3 years ago

I'm running the SQL Tabs v1.1.0, the last release to MacOSX Catalina (10.15.7) and for each query execution for both MySQL and PostgreSQL databases the SQL Tabs open a new connection, in some time I reach the limit of max_connection of the database and drop down all application using that database.

Anyone have same problem?

I like too much of this sql client, but I don't programming in JS to debug and fix that.

Thanks

sasha-alias commented 3 years ago

Hi, SQL Tabs opens a connection for each tab, plus it opens one more connection per unique connection string for fetching autocompletion metadata. I think it doesn't open connectoin for each query, it would be too much. Probbably the issue is it doesn't close a connection when a tab get closed. So when you open and close tabs pretty often you might run out of max_connections. That's true. I will take a look how to fix it, but for the moment I would suggest to reuse existing tabs rather than open and close new ones.

willyrgf commented 3 years ago

Hi there, I made a lot of tests and in my test I could understand that:

Maybe you can reproduce that.