Обсуждение: explain statements question

Поиск
Список
Период
Сортировка

explain statements question

От
LM
Дата:
We're using PostgreSQL (10.6) as part of a product at work that's maintained by a third party company.  I've been monitoring queries to the PostgreSQL database using PGAdmin3's server status functionality.  Lately, we've been seeing a lot of queries (via the server status page and or checking pg_stat_activity) that start with Explain (FORMAT XML, VERBOSE true).  Would explain ever be run because of a PostgreSQL setting or another SQL statement sent to the database or would we only see this if the application sent a literal "explain" command in SQL to the database?  Am trying to find out why we are seeing so many explain statements after the last upgrade and whether they are valid commands or perhaps someone just left debug statements of some kind in the application. 

Also, if someone knows a good replacement tool for the server status page in PGAdmin3 that will work with later versions of PostgreSQL (such as 12), would very much appreciate hearing about it.

Thank you.

Re: explain statements question

От
Tom Lane
Дата:
LM <lmemsm@gmail.com> writes:
> We're using PostgreSQL (10.6) as part of a product at work that's
> maintained by a third party company.  I've been monitoring queries to the
> PostgreSQL database using PGAdmin3's server status functionality.  Lately,
> we've been seeing a lot of queries (via the server status page and or
> checking pg_stat_activity) that start with Explain (FORMAT XML, VERBOSE
> true).  Would explain ever be run because of a PostgreSQL setting or
> another SQL statement sent to the database or would we only see this if the
> application sent a literal "explain" command in SQL to the database?

Something is sending that.

> Also, if someone knows a good replacement tool for the server status page
> in PGAdmin3 that will work with later versions of PostgreSQL (such as 12),
> would very much appreciate hearing about it.

The pgAdmin people will tell you to switch to pgAdmin 4.  I don't
know enough about the differences to know what problems that might
create for you, but that's the official position.  pgAdmin 3 is
out of support.

            regards, tom lane



Re: explain statements question

От
LM
Дата:
On Tue, Nov 5, 2019 at 9:42 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Something is sending that.

That was my suspicion.  Thanks for confirming.

At to switching to pgAdmin4, I have that up and running, but there is no equivalent to the server status functionality in pgAdmin3 as far as I can tell.  I did a search on the Internet to see if pgAdmin4 offered similar functionality and the posts I read indicated it did not.

I realize pgAdmin3 is out of support, but I've seen at least a half dozen projects that have forked it and are attempting to get it to work with later versions of PostgreSQL 11 and 12.  I'm investigating building it from source now with some of the various patches from these forks.  Would be very interested in either getting involved with one of the projects that has forked pgAdmin3 or possibly pulling out some of the useful functionality like the server status capability and creating a separate application (maybe with a different user interface library).  I build and personally maintain several C/C++ projects that are no longer officially maintained by other developers.  Would have no issues with maintaining and using a project that had no official support as long as I could compile and debug it myself.