Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9F3542E01B2 for ; Sat, 8 Mar 2008 02:13:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 82278-08 for ; Sat, 8 Mar 2008 02:13:14 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id C8ED82E01A6 for ; Sat, 8 Mar 2008 02:13:13 -0400 (AST) 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 m286DCul016335; Sat, 8 Mar 2008 01:13:12 -0500 (EST) To: Greg Smith cc: pgsql-performance@postgresql.org Subject: Re: count * performance issue In-reply-to: References: <47D00DB2.7040007@emolecules.com> <18451.1204824562@sss.pgh.pa.us> <200803071727.36146.josh@agliodbs.com> <13345.1204940295@sss.pgh.pa.us> Comments: In-reply-to Greg Smith message dated "Sat, 08 Mar 2008 00:08:39 -0500" Date: Sat, 08 Mar 2008 01:13:12 -0500 Message-ID: <16334.1204956792@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/178 X-Sequence-Number: 29132 Greg Smith writes: > I know when I'm playing with pgbench the primary key index on the big > accounts table is 1/7 the size of the table, and when using that table > heavily shared_buffers ends up being mostly filled with that index. The > usage counts are so high on the index blocks relative to any section of > the table itself that they're very sticky in memory. And that's toy data; > on some of the webapps people want these accurate counts for the ratio of > index size to table data is even more exaggerated (think web forum). Remember that our TOAST mechanism acts to limit the width of the main-table row. regards, tom lane