X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B3D11475A45 for ; Wed, 16 Apr 2003 12:01:52 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id F24CE475458 for ; Wed, 16 Apr 2003 12:01:51 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3GG1uU6018665; Wed, 16 Apr 2003 12:01:56 -0400 (EDT) To: Andrew Sullivan Cc: pgsql-performance@postgresql.org Subject: Re: for help! In-reply-to: <20030416155312.GF19999@libertyrms.info> References: <200304160848.36431.josh@agliodbs.com> <20030416155312.GF19999@libertyrms.info> Comments: In-reply-to Andrew Sullivan message dated "Wed, 16 Apr 2003 11:53:12 -0400" Date: Wed, 16 Apr 2003 12:01:56 -0400 Message-ID: <18664.1050508916@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-31.7 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/144 X-Sequence-Number: 1650 Andrew Sullivan writes: > But you _could_ write a trigger which inserts into a "staging" table, > and write a little daemon which only updates the count table with the > data from the staging table. It's a mighty ugly hack, but it ought > to work. The $64 question with this sort of thing is "how accurate (up-to-date) does the count have to be?". Given that Josh is willing to vacuum every five minutes, he might find that returning pg_class.reltuples is Close Enough (TM). regards, tom lane