Hash id in pg_stat_statements - Mailing list pgsql-hackers

From Magnus Hagander
Subject Hash id in pg_stat_statements
Date
Msg-id CABUevExLnb6xJwS=8rTaLOfDOS-tFm09==Z2M_vz5hhFkgWBTg@mail.gmail.com
Whole thread Raw
Responses Re: Hash id in pg_stat_statements  (Peter Geoghegan <peter@2ndquadrant.com>)
Re: Hash id in pg_stat_statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Hash id in pg_stat_statements  (Daniel Farina <daniel@heroku.com>)
List pgsql-hackers
Can we please expose the internal hash id of the statements in
pg_stat_statements?

I know there was discussions about it earlier, and it wasn't done with
an argument of it not being stable between releases (IIRC). I think we
can live with that drawback, assuming of course that we document this
properly.

I've now run into multiple customer installations where it would be
very useful to have. The usecase is mainly storing snapshots of the
pg_stat_statements output over time and analyzing those. Weird things
happen for example when the query text is the same, but the hash is
different (which can happen for example when a table is dropped and
recreated). And even without that, in order to do anything useful with
it, you end up hashing the query text anyway - so using the already
existing hash would be easier and more useful.

-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/



pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: [9.1] 2 bugs with extensions
Next
From: Heikki Linnakangas
Date:
Subject: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown