Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 9BBBD2E0032 for ; Mon, 19 May 2008 12:38:07 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67001-08 for ; Mon, 19 May 2008 12:38:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 3F4432E003B for ; Mon, 19 May 2008 12:38:01 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m4JFbwSL005698; Mon, 19 May 2008 11:37:58 -0400 (EDT) To: Bruce Momjian cc: Matthew Wakeling , pgsql-performance@postgresql.org Subject: Re: I/O on select count(*) In-reply-to: <200805191454.m4JEs6400890@momjian.us> References: <200805191454.m4JEs6400890@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Mon, 19 May 2008 10:54:06 -0400" Date: Mon, 19 May 2008 11:37:58 -0400 Message-ID: <5697.1211211478@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/267 X-Sequence-Number: 30235 Bruce Momjian writes: > Matthew Wakeling wrote: >> Does it really take that long to zero out 8kB of RAM? I thought CPUs were >> really quick at doing that! > Yea, that was my assumption too. You have to write the page (to be sure there is space for it on disk) not only zero it. This design is kind of a holdover, though, from back when we had one ever-growing clog file. Today I'd be inclined to think about managing it more like pg_xlog, ie, have some background process pre-create a whole segment file at a time. regards, tom lane