Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZisQt-0002Ic-QZ for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Oct 2015 23:11:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZisQt-000655-3R for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Oct 2015 23:11:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZisQr-00064L-Ii for pgsql-hackers@postgresql.org; Sun, 04 Oct 2015 23:11:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZisQo-0007aL-Vx for pgsql-hackers@postgresql.org; Sun, 04 Oct 2015 23:11:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t94NAuui032133; Sun, 4 Oct 2015 19:10:56 -0400 From: Tom Lane To: Andrew Dunstan cc: Peter Geoghegan , Jim Nasby , Pg Hackers Subject: Re: Less than ideal error reporting in pg_stat_statements In-reply-to: <5611AF21.9090900@dunslane.net> References: <5601D354.5000703@BlueTreble.com> <5913.1443822154@sss.pgh.pa.us> <9935.1443828452@sss.pgh.pa.us> <32385.1443976035@sss.pgh.pa.us> <26165.1443988873@sss.pgh.pa.us> <30415.1443996994@sss.pgh.pa.us> <5611AF21.9090900@d! unslane.net> Comments: In-reply-to Andrew Dunstan message dated "Sun, 04 Oct 2015 18:58:41 -0400" Date: Sun, 04 Oct 2015 19:10:56 -0400 Message-ID: <32132.1444000256@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andrew Dunstan writes: > Sorry, I'm a bit late to this party. Does what you have committed mean > people are less likely to see "Out of Memory" coming from > pg_stat_statements? If not, what can be done about them short of a > restart? And what bad effects follow from an event generating them? The main thing we've done that will alleviate that is increase the size of query text file that the garbage-collection routine can cope with from MaxAllocSize (1GB) to MaxAllocHugeSize (at least 2GB, lots more on 64bit machines, though on 32-bit you probably can't get to 2GB anyway ...). Also, what will now happen if you do get an out-of-memory is that the code will discard stored query texts and truncate the file, so that the problem doesn't recur (at least not till you build up a new set of stored query texts). At this point you still have statistics, but they can only be identified by query ID since the text has been forgotten. I'm not sure how useful that situation really is ... > The docs seem to be quite silent on these points. The docs probably ought to describe this situation and recommend reducing pg_stat_statements.max if you want to preserve query texts. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers