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 4979BD1B179 for ; Fri, 23 Jul 2004 14:42:29 -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 49692-02 for ; Fri, 23 Jul 2004 17:42:25 +0000 (GMT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id EA9CBD1B1A1 for ; Fri, 23 Jul 2004 14:42:21 -0300 (ADT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id i6NHg1X21123; Fri, 23 Jul 2004 19:42:03 +0200 Received: from [127.0.0.1] (accesspoint.mm.eutelsat.org [194.214.173.4]) by nts-03.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id i6NHg8X26376; Fri, 23 Jul 2004 19:42:08 +0200 Message-ID: <41014DE1.8000007@bigfoot.com> Date: Fri, 23 Jul 2004 19:41:53 +0200 From: Gaetano Mendola User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Dennis Bjorklund , "pgsql-performance@postgresql.org" Subject: Re: [HACKERS] Wrong index choosen? References: <20162.1090593927@sss.pgh.pa.us> In-Reply-To: <20162.1090593927@sss.pgh.pa.us> X-Enigmail-Version: 0.84.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/156 X-Sequence-Number: 7547 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tom Lane wrote: | Dennis Bjorklund writes: | |>In this plan it estimates to get 481 but it got 22477. So the estimation |>was very wrong. You can increase the statistics tarhet on the login_time |>and it will probably be better (after the next analyze). | | | 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. Thank you all. Regards Gaetano Mendola -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBAU3g7UpzwH2SGd4RAhbEAKDLbKXLGRqphBbfyBh6cu7QoqFQhACfdDtu cGS0K1UuTuwTDp4P2JjQ30A= =aepf -----END PGP SIGNATURE-----