Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4049B2E00CB for ; Fri, 21 Mar 2008 10:54:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 81742-02 for ; Fri, 21 Mar 2008 10:54:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by postgresql.org (Postfix) with ESMTP id 7D0D22E005C for ; Fri, 21 Mar 2008 10:54:39 -0300 (ADT) Received: from vanquish.ws.pitbpa0.priv.collaborativefusion.com (vanquish.ws.pitbpa0.priv.collaborativefusion.com [192.168.2.162]) (SSL: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Fri, 21 Mar 2008 09:54:29 -0400 id 00056413.47E3BE15.000022BC Date: Fri, 21 Mar 2008 09:54:37 -0400 From: Bill Moran To: "Laurent Raufaste" Cc: pgsql-performance@postgresql.org Subject: Re: PG writes a lot to the disk Message-Id: <20080321095437.2a4a9ce6.wmoran@collaborativefusion.com> In-Reply-To: <669dc9710803210645m530b492cs6de98f215bcecb23@mail.gmail.com> References: <669dc9710803190418g45002e87k19cb742579c1eeac@mail.gmail.com> <669dc9710803200348x64122249jd2ac5924d78a6da0@mail.gmail.com> <20080320105833.c539476d.wmoran@collaborativefusion.com> <10279.1206026439@sss.pgh.pa.us> <669dc9710803210349x764b2ec7k5aa95e33afefa926@mail.gmail.com> <87prtoqkdk.fsf@oxford.xeocode.com> <669dc9710803210645m530b492cs6de98f215bcecb23@mail.gmail.com> Organization: Collaborative Fusion X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.8; i386-portbld-freebsd6.3) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/423 X-Sequence-Number: 29377 In response to "Laurent Raufaste" : > 2008/3/21, Gregory Stark : > > > > Well that's true it does. But only once per row. So analyze would have set the > > bit on every row. You could do the same thing with something ligter like > > "select count(*) from ". > > Well, the table has been analyzed, I did SELECT, PG write on the > table. That's a fact. > > But it's also true (I juste tested it) that every file of a table is > modified by a SELECT COUNT. The real question (to verify Tom's point) is does a _second_ SELECT count() modify the table again? If so, then something else is going on than what Tom suggested. -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ wmoran@collaborativefusion.com Phone: 412-422-3463x4023