X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 261404763A8 for ; Tue, 22 Apr 2003 04:23:39 -0400 (EDT) Received: from flake.decibel.org (flake.decibel.org [66.93.216.19]) by postgresql.org (Postfix) with SMTP id DB2664763AF for ; Tue, 22 Apr 2003 04:23:37 -0400 (EDT) Received: (qmail 37985 invoked by uid 1001); 22 Apr 2003 08:23:39 -0000 Date: Tue, 22 Apr 2003 03:23:39 -0500 From: "Jim C. Nasby" To: Josh Berkus Cc: Tom Lane , Kevin Brown , pgsql-performance@postgresql.org Subject: Re: [SQL] Yet Another (Simple) Case of Index not used Message-ID: <20030422032339.A37876@flake.decibel.org> Reply-To: jim@nasby.net References: <20030419130146.GI1847@filer> <21955.1050767928@sss.pgh.pa.us> <200304191203.18634.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200304191203.18634.josh@agliodbs.com>; from josh@agliodbs.com on Sat, Apr 19, 2003 at 12:03:18PM -0700 X-Operating-System: FreeBSD 4.7-RELEASE-p3 i386 X-Distributed: Join the Effort! http://www.distributed.net X-Spam-Status: No, hits=-39.4 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,SIGNATURE_SHORT_SPARSE, USER_AGENT_MUTT 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/187 X-Sequence-Number: 1693 On Sat, Apr 19, 2003 at 12:03:18PM -0700, Josh Berkus wrote: > Kevin, Tom: > > > (The cheapness can be disputed as well, since it creates a single point > > of contention for all inserts and deletes on the table. But that's a > > different topic.) > > Actually, this was the problem with the trigger method of maintaining COUNT > information in PostgreSQL. The statistics table itself becomes a > significant souce of delay, since if a table_A gets 10,000 rows updated than > table_count_A must necessarily be updated 10,000 times ... creating a lot of > dead tuples and severely attenuating the table on disk until the next vacuum > ... resulting in Update #10,000 to table_count_A taking 100+ times as long as > Update #1 does, due to the required random seek time on disk. Once statement level triggers are implimented, the performance would probably be fine, assuming your update was a single statement. -- Jim C. Nasby (aka Decibel!) jim@nasby.net Member: Triangle Fraternity, Sports Car Club of America Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"