Content assist / autocomplete hangs the server (latest pgAdmin version) - Mailing list pgadmin-support

From Cherio
Subject Content assist / autocomplete hangs the server (latest pgAdmin version)
Date
Msg-id CAKHqFk+SQLcdMXGmxQrNzXbpcqaVfqMLUsz=8EU26nF38V30vg@mail.gmail.com
Whole thread Raw
In response to Re: Upgradede Pgadmin4 to v6.12 - new startup error  (Dave Page <dpage@pgadmin.org>)
Responses Re: Content assist / autocomplete hangs the server (latest pgAdmin version)  (Akshay Joshi <akshay.joshi@enterprisedb.com>)
List pgadmin-support
I had to examine certain aspects of a query that looks like this:

SELECT COUNT(*)
FROM schema.table
WHERE id IN (
'1',
'2',
'3',
....
'19998',
'19999',
'20000'
)

I pasted the query and autocomplete kicked in. For a minute it froze entirely. Then it sort of let me do things but everything was like in slow motion: the tree browser, the other SQL tabs - everything became slow as molasses. I logged onto the server and the "pgAdmin4.py" was keeping the CPU quite busy. It didn't recover for some time so I simply restarted the server and switched autocomplete to manual.

Not knowing the design I may not be able to make a viable suggestion but maybe some sort of complexity counter (configurable or at least hard-coded at first) should be considered, which would hint to the autocomplete to stop trying, after it realizes the task may be too complex or takes too long to complete.

Sure, a query like the one above should probably make use of a temporary table but it is beyond the point - there has to be a safeguard against an overloaded autocomplete. Without such a safeguard an ugly/invalid query or a user error could kill the server for all connected pgadmin clients.

pgadmin-support by date:

Previous
From: Dave Page
Date:
Subject: pgAdmin User Survey 2022 - Results!
Next
From: "Periklis F. Didaskalou"
Date:
Subject: Is it possible to direct pgadm4 installer to use the /var folder within postrgres GUIX System Home folder?