On 1 October 2017 at 16:40, Tom Lane <t...@sss.pgh.pa.us> wrote: > Greg Stark <st...@mit.edu> writes: >> Indeed. It's simple enough to export stats to prometheus with queryid >> as the key. Then even if the query ages out of the database stats you >> have graphs and derivative metrics going further back. > > I'm not really ready to buy into that as a supported use-case, because > it immediately leads to the conclusion that we need to promise stability > of query IDs across PG versions, which seems entirely infeasible to me > (at least with anything like the current method of deriving them).
Well these kinds of monitoring systems tend to be used by operations people who are a lot more practical and a lot less worried about theoretical concerns like that. What they're going to want to do is things like "alert on any query using more than 0.1 cpu core" or "alert on any query being the top i/o consumer that isn't amongst the top 10 over the previous day" or "alert on any query using more than 4x the cpu or i/o on one database than it does on average across all our databases". That last one is a case where it would be nice if the queryid values were stable across versions but it's hardly surprising that they aren't. In context the point was merely that the default pg_stat_statements.max of 5000 isn't sufficient to argue that 32-bit values are enough. It wouldn't be hard for there to be 64k different queries over time and across all the databases in a fleet and at that point it becomes likely there'll be a 32-bit collision. -- greg -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers