X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 26874475CA9 for ; Sun, 20 Apr 2003 11:38:00 -0400 (EDT) Received: from smtp.web.de (smtp03.web.de [217.72.192.158]) by postgresql.org (Postfix) with ESMTP id 6E62747580B for ; Sun, 20 Apr 2003 11:37:59 -0400 (EDT) Received: from p5081845f.dip0.t-ipconnect.de ([80.129.132.95] helo=web.de) by smtp.web.de with asmtp (TLSv1:RC4-MD5:128) (WEB.DE(Exim) 4.97 #53) id 197GtB-0001De-00; Sun, 20 Apr 2003 17:37:57 +0200 Message-ID: <3EA2BED5.9010707@web.de> Date: Sun, 20 Apr 2003 17:37:57 +0200 From: Andreas Pflug User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane , pgsql-performance@postgresql.org Subject: Re: [SQL] Yet Another (Simple) Case of Index not used References: <200304090918.45275.josh@agliodbs.com> <20030419130146.GI1847@filer> <21955.1050767928@sss.pgh.pa.us> <20030420011336.GJ1847@filer> <24735.1050809664@sss.pgh.pa.us> <20030420062852.GK1847@filer> <3EA27179.6010307@web.de> <27004.1050852329@sss.pgh.pa.us> In-Reply-To: <27004.1050852329@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-34.4 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,RCVD_IN_NJABL, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA 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/180 X-Sequence-Number: 1686 Tom Lane wrote: >It would be counting the wrong thing. auto-vacuum needs to know how >many dead tuples are in a table, not how many live ones. Example: >UPDATE doesn't change the live-tuple count (without this property, >I don't think the sort of count maintenance Kevin is proposing could >possibly be efficient enough to be interesting). But it does create >a dead tuple that vacuum wants to know about. > > > I understand your point, but is this about VACUUM only or VACUUM ANALYZE too? People wouldn't bother about big databases if it's still fast (until the disk is full :-) Do dead tuples affect query planning? I thought the plan only cares about existing rows and their data patterns. So count(*), pg_stat_all_tables.n_tup_ins, .n_tup_upd and .n_tup_del all together can make a VACUUM ANALYZE necessary, right? Regards, Andreas