Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"
Date: 2014-07-20 11:39:19
Message-ID: alpine.DEB.2.10.1407201326500.16752@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello devs,

> I noticed that my pg_stat_statements is cluttered with hundreds of entries
> like "DEALLOCATE dbdpg_p123456_7", occuring each only once.

Here is a patch and sql test file to:

* normalize DEALLOCATE utility statements in pg_stat_statements

Some drivers such as DBD:Pg generate process/counter-based identifiers for
PREPARE, which result in hundreds of DEALLOCATE being tracked, although
the prepared query may be the same. This is also consistent with the
corresponding PREPARE not being tracked (although the underlying prepared
query *is* tracked).

** Note **: another simpler option would be to skip deallocates altogether
by inserting a "&& !IsA(parsetree, DeallocateStmt)" at the beginning of
pgss_ProcessUtility(). I'm not sure what is best.

--
Fabien.

Attachment Content-Type Size
pgss-norm-deallocate.patch text/x-diff 1.3 KB
pgss-norm-deallocate.sql application/x-sql 557 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-07-20 11:54:01 Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"
Previous Message Simon Riggs 2014-07-20 09:01:10 Re: Built-in binning functions