Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*" - Mailing list pgsql-hackers

From Andres Freund
Subject Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"
Date
Msg-id 20140720124537.GE24864@alap3.anarazel.de
Whole thread Raw
In response to Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
On 2014-07-20 14:43:27 +0200, Fabien COELHO wrote:
> >a) Consider using the extended query protocol.
> >b) consider using unnamed prepared statements to reduce the number of
> >  roundtrips
> >c) wonder why PREPARE/DEALLOCATE are so much more frequent than the
> >  actualy query execution.
> 
> (1) I'm not responsible for DBD::Pg allocating "random" names to prepared
> statements, even if the queries are the same, and that accumulate over time
> (weeks, possibly months).
> 
> (2) pg_stat_statements is currently inconsistent anyway, as PREPARE is not
> counted (but the underlying query is on each EXECUTE), although its
> corresponding DEALLOCATE is counted, so I think that something is needed for
> consistency.

That's because PREPARE isn't executed as it's own statement, but done on
the protocol level (which will need noticeably fewer messages). There's
no builtin logic to ignore actual PREPARE statements. So I don't think
your consistency argument counts as much here.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"
Next
From: Tomas Vondra
Date:
Subject: Re: tweaking NTUP_PER_BUCKET