Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining system queries into one batch. #1672

Open
OXYAMINE opened this issue Sep 28, 2022 · 2 comments
Open

Combining system queries into one batch. #1672

OXYAMINE opened this issue Sep 28, 2022 · 2 comments

Comments

@OXYAMINE
Copy link

Is your feature request related to a problem? Please describe.
Very slow performance working with large MySQL databases (big number of objects) and significant network lag.
Nowadays most of us working with cloud databases where physical location could be on the other side of the planet.
Even with fast connections network lag is sufficient to affect user experience.
Especially when many SQL statements are being sent in a loop.

For example when MySQL DB connection is established Heidi sends 5 queries one by one:
SELECT CONNECTION_ID()\
SHOW STATUS\
SELECT NOW()\
SHOW VARIABLES\
SHOW DATABASES\

Consider network lag of 150-200ms between each calls and total delay is up to a second (in reality it's even more)

Next is even worse:
Opening database - 12 separate calls:
*SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME='c'\
SHOW TABLE STATUS FROM c\
SHOW FUNCTION STATUS WHERE Db='c'\
SHOW PROCEDURE STATUS WHERE Db='c'\
SHOW TRIGGERS FROM c\
SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME='information_schema'\
SHOW TABLE STATUS FROM information_schema\
SHOW FUNCTION STATUS WHERE Db='information_schema'\
SHOW PROCEDURE STATUS WHERE Db='information_schema'\
SHOW TRIGGERS FROM information_schema\
SHOW EVENTS FROM information_schema\
SELECT , EVENT_SCHEMA AS Db, EVENT_NAME AS Name FROM information_schema.EVENTS WHERE EVENT_SCHEMA='4'\

Next is even more worse: when typing "." Heidi UI tries to use autocomplete function and fetches all object names.
IT sends separate SHOW CREATE PROCEDURE or SHOW CREATE FUNCTION for each object in the database!
Imagine I have 500-700 objects in the database (sometimes more): 75 sec - 2.3 min delay is guaranteed.
Yes this is a one-off operation (in the session) and next call will be cached but this first time is a killer!
Reconnected to the database? have to wait again.

Describe the solution you'd like
I think combining queries into one batch (where possible) should remove network lag problem.

Describe alternatives you've considered
I don't see any alternatives, only if autocomplete feature could be disabled. But this is not what we want.

Additional context
N\A

@ansgarbecker
Copy link
Collaborator

Please disable "Full table status" in your session to see if that makes a difference:

grafik

Apart from that, some of the queries won't be quicker if combined in a batch.

Also, you should probably disable the completion proposal:

grafik

@OXYAMINE
Copy link
Author

OXYAMINE commented Sep 28, 2022

@ansgarbecker Get full table status doesn't help as it is mainly about procedures and functions.
Disabling "Enable autocompletion" checkbox helps but why the whole UI feature needs to be disabled if there is a better way of sending requests?
Also autocompletion isn't related to system calls at establishing connection or opening a database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants