Re: Less than ideal error reporting in pg_stat_statements
Peter Geoghegan <pg@heroku.com>
From: Peter Geoghegan <pg@heroku.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>,
Andrew Dunstan <andrew@dunslane.net>,
Jim Nasby <Jim.Nasby@bluetreble.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2015-10-05T17:38:27Z
Lists: pgsql-hackers
On Mon, Oct 5, 2015 at 8:50 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > That's certainly something worth looking at, but I think it's probably > more complicated than that. If you just write "WHERE x IN (1,2,3,4)", > that gets folded to a ScalarArrayOp with a single array constant, which > the existing code would deal with just fine. We need to identify > situations where that's not the case but yet we shouldn't distinguish. I have a certain amount of sympathy for doing that kind of thing, but significantly less than I have for cases with many failed queries, which is why I focused on that. > In any case, that's just a marginal tweak for one class of query. Sometimes narrow cases are also important and representative cases. I don't care if someone has thrashing type issues with pg_stat_statements when they're doing something really odd that calls into question the purpose of using it to begin with [1]. The two classes of queries we talked about (1. Many aborted data integration transactions, and 2. A variable number of constants) are interesting because a reasonable person could have those cases, and run into trouble with pg_stat_statements as a consequence. > I suspect the right fix for the core problem is the one Peter mentioned > in passing earlier, namely make it possible to do garbage collection > without having to slurp the entire file into memory at once. It'd be > slower, without a doubt, but we could continue to use the existing code > path unless the file gets really large. While it would be nice to not lose query texts on OOM, that's not my primary concern. My primary concern is infrequent garbage collection. This fix certainly isn't going to help with the fact that garbage collection can be stalled for far too long in at least quasi-reasonable cases. [1] http://www.postgresql.org/message-id/52E9D98A.4000007@lab.ntt.co.jp -- Peter Geoghegan
Commits
-
Be more wary about 32-bit integer overflow in pg_stat_statements.
- c67c2e2a2939 16.0 landed
- dd414bf4e047 10.22 landed
- 82ebc70d1c7f 15.0 landed
- 6b67db10c366 13.8 landed
- 6608a4305636 12.12 landed
- 17fd203b414e 14.5 landed
- 06f6a07ba465 11.17 landed