Re: Cached Query Plans

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>
Cc: Perez <arturo(at)ethicist(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Cached Query Plans
Date: 2008-04-15 07:58:41
Message-ID: 82prsrmtvy.fsf@mid.bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)bfk(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2008-04-15 08:11:32 Re: printTable API (was: Show INHERIT in \du)
Previous Message Magnus Hagander 2008-04-15 07:56:21 Re: pgwin32_safestat weirdness