X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6F246D1B220 for ; Fri, 23 Jul 2004 15:12:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 60508-05 for ; Fri, 23 Jul 2004 18:12:20 +0000 (GMT) Received: from outbound.mailhop.org (outbound.mailhop.org [63.208.196.171]) by svr1.postgresql.org (Postfix) with ESMTP id 1661DD1B179 for ; Fri, 23 Jul 2004 15:12:17 -0300 (ADT) Received: from ool-4350c7ad.dyn.optonline.net ([67.80.199.173] helo=[192.168.0.66]) by outbound.mailhop.org with asmtp (TLSv1:AES256-SHA:256) (Exim 4.20) id 1Bo4Wl-0006uJ-UU; Fri, 23 Jul 2004 14:12:15 -0400 Message-ID: <410154F9.3080500@zeut.net> Date: Fri, 23 Jul 2004 14:12:09 -0400 From: "Matthew T. O'Connor" User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gaetano Mendola Cc: Tom Lane , Dennis Bjorklund , "pgsql-performance@postgresql.org" Subject: Re: [HACKERS] Wrong index choosen? References: <20162.1090593927@sss.pgh.pa.us> <41014DE1.8000007@bigfoot.com> In-Reply-To: <41014DE1.8000007@bigfoot.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Mail-Handler: MailHop Outbound by DynDNS.org X-Originating-IP: 67.80.199.173 X-Report-Abuse-To: abuse@dyndns.org (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: zeut X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/157 X-Sequence-Number: 7548 Gaetano Mendola wrote: > Tom Lane wrote: > | Given the nature of the data (login times), I'd imagine that the problem > | is simply that he hasn't analyzed recently enough. A bump in stats > | target may not be needed, but he's going to have to re-analyze that > | column often if he wants this sort of query to be estimated accurately, > | because the fraction of entries later than a given time T is *always* > | going to be changing. > > Well know that I think about it, I felt my shoulders covered by > pg_autovacuum but looking at the log I see that table never analyzed! > Aaargh. > > I already applied the patch for the autovacuum but evidently I have to > make it more aggressive, I'm sorry that I can not made him more aggressive > only for this table. Yeah, the version of autovacuum in 7.4 contrib doesn't allow table specific settings. The patch I have sumbitted for 7.5 does, so hopefully this will be better in the future. You can however set the VACUUM and ANALYZE thresholds independently. So perhpaps it will help you if you set your ANALYZE setting to be very aggressive and your VACUUM settings to something more standard. Matthew