X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6D410475AA9 for ; Sat, 19 Apr 2003 16:26:50 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 996404758C9 for ; Sat, 19 Apr 2003 16:26:49 -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 h3JKQnU6023266; Sat, 19 Apr 2003 16:26:49 -0400 (EDT) To: Josh Berkus Cc: Kevin Brown , pgsql-performance@postgresql.org Subject: Re: [SQL] Yet Another (Simple) Case of Index not used In-reply-to: <200304191203.18634.josh@agliodbs.com> References: <20030419130146.GI1847@filer> <21955.1050767928@sss.pgh.pa.us> <200304191203.18634.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Sat, 19 Apr 2003 12:03:18 -0700" Date: Sat, 19 Apr 2003 16:26:49 -0400 Message-ID: <23265.1050784009@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-29.1 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,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/173 X-Sequence-Number: 1679 Josh Berkus writes: > In PostgreSQL: > a) Put table_count_A on superfast media like a RAM card so that random seeks > after 10,000 updates do not become a significant delay; As long as we're talking ugly, here ;-) You could use a sequence to hold the aggregate counter. A sequence isn't transactional and so does not accumulate dead tuples. "setval()" and "select last_value" should have constant-time performance. regards, tom lane