Re: Cached Query Plans - Mailing list pgsql-hackers

From Florian Weimer
Subject Re: Cached Query Plans
Date
Msg-id 82prsrmtvy.fsf@mid.bfk.de
Whole thread Raw
In response to Re: Cached Query Plans (was: global prepared statements)  ("Dawid Kuroczko" <qnex42@gmail.com>)
List pgsql-hackers
* Dawid Kuroczko:

> Right now the only way of getting such information from PostgreSQL
> is by logging all queries and analyzing logs.  The current_query
> column of pg_stat_activity is useless as the (prepared) queries are
> usually so short lived that you will see one execution out of
> thousands happening.

If the cached plans are kept a bit longer than actually necessary, it
might also be possible to see the query plan of a query that involves
temporary tables, something that is somewhat convoluted to do
otherwise (ptop uses the query string from pg_stat_activity and tacks
an EXPLAIN in front of it, which breaks with temporary tables).

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pgwin32_safestat weirdness
Next
From: "Brendan Jurd"
Date:
Subject: Re: printTable API (was: Show INHERIT in \du)