Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VcOtl-0004un-5j for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Nov 2013 00:17:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VcOtk-0003zn-MD for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Nov 2013 00:17:04 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VcOtj-0003zc-RQ for pgsql-hackers@postgreSQL.org; Sat, 02 Nov 2013 00:17:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VcOth-0005x5-Fj for pgsql-hackers@postgreSQL.org; Sat, 02 Nov 2013 00:17:03 +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 rA20H06x011502; Fri, 1 Nov 2013 20:17:00 -0400 From: Tom Lane To: g.vanluffelen@qipc.com, pgsql-hackers@postgreSQL.org Subject: Re: [BUGS] BUG #8573: int4range memory consumption In-reply-to: <18832.1383332908@sss.pgh.pa.us> References: <18832.1383332908@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 01 Nov 2013 15:08:28 -0400" Date: Fri, 01 Nov 2013 20:17:00 -0400 Message-ID: <11501.1383351420@sss.pgh.pa.us> X-Pg-Spam-Score: -1.0 (-) 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 I wrote: > It's possible that this would result in some net slowdown in tuple output; > but it's also possible that eliminating the retail pfree's in favor of a > single context reset per tuple would make for a net savings. In any case, > we're already using a reset-per-row approach to memory management of > output function calls in COPY OUT, and I know for a fact that we've > squeezed that code path as hard as we could. It appears that indeed, the reset-per-row approach is marginally faster than the existing code. It's just barely faster with a couple of columns of output, for instance I get about 660 vs 665 msec for select x,x from generate_series(1,1000000) x; but the advantage grows for more columns, which is expected since we're getting rid of more pfree's. With ten integer columns I see 1650 vs 1710 msec, for example. So I see no downside to fixing it like this, and will work on a complete patch. 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