Re: BUG #14901: Canceled queries missing from pg_stat_statements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: gregburek(at)heroku(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14901: Canceled queries missing from pg_stat_statements
Date: 2017-11-13 01:39:27
Message-ID: 4671.1510537167@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2017-11-12 22:28:11 +0000, gregburek(at)heroku(dot)com wrote:
>> [ canceled queries aren't accounted for by pg_stat_statements ]

> One way to address this at least partially would be to add a counter for
> initiated queries and a counter for completed queries (the current
> one). If all the rest of the counters are left the same the issue from
> above isn't there, and you'd not even need an exception handler to
> update counters.

That seems like an idea well worth looking into, seeing that there's
already a code path that inserts the entry into the shared table before
execution starts.

This would not account for queries that fail at parse or plan time,
but hopefully those generally don't run long enough to be a problem.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2017-11-13 07:32:31 Re: BUG #14866: The generated constraint in the typed table causes the server to crash
Previous Message Michael Paquier 2017-11-13 00:09:36 Re: BUG #14897: Segfault on statitics SQL request