X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 693209DC832 for ; Tue, 3 Jan 2006 12:35:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18467-10 for ; Tue, 3 Jan 2006 12:35:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from flake.decibel.org (unknown [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 4991D9DC80F for ; Tue, 3 Jan 2006 12:35:56 -0400 (AST) Received: by flake.decibel.org (Postfix, from userid 1001) id 0AABA39841; Tue, 3 Jan 2006 10:35:56 -0600 (CST) Date: Tue, 3 Jan 2006 10:35:56 -0600 From: "Jim C. Nasby" To: Simon Riggs Cc: Tom Lane , Qingqing Zhou , pgsql-hackers@postgresql.org Subject: Re: Stats collector performance improvement Message-ID: <20060103163556.GH82560@pervasive.com> References: <200601021840.k02Ieed21704@candle.pha.pa.us> <11924.1136233224@sss.pgh.pa.us> <12503.1136238525@sss.pgh.pa.us> <1136281253.5052.113.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1136281253.5052.113.camel@localhost.localdomain> X-Operating-System: FreeBSD 6.0-RELEASE amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.067 required=5 tests=[AWL=0.067] X-Spam-Score: 0.067 X-Spam-Level: X-Archive-Number: 200601/102 X-Sequence-Number: 78206 On Tue, Jan 03, 2006 at 09:40:53AM +0000, Simon Riggs wrote: > On Mon, 2006-01-02 at 16:48 -0500, Tom Lane wrote: > We can also save lots of cycles on the current statement overhead, which > is currently the worst part of the stats, performance-wise. That > definitely needs redesign. AFAICS we only ever need to know the SQL > statement via the stats system if the statement has been running for > more than a few minutes - the main use case is for an admin to be able > to diagnose a rogue or hung statement. Pushing the statement to stats > every time is just a big overhead. That suggests we should either have a > pull or a deferred push (longer-than-X-secs) approach. I would argue that minutes is too long, but of course this could be user-adjustable. I suspect that even waiting just a second could be a huge win, since this only matters if you're executing a lot of statements and you won't be doing that if those statements are taking more than a second or two to execute. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461