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 C9B54D1B215 for ; Fri, 23 Jul 2004 21:08:07 -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 97398-02 for ; Sat, 24 Jul 2004 00:07:49 +0000 (GMT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id 394F4D1B1F8 for ; Fri, 23 Jul 2004 21:07:43 -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 i6O07Zt22596; Sat, 24 Jul 2004 02:07:36 +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 i6O07gX27874; Sat, 24 Jul 2004 02:07:42 +0200 Message-ID: <4101A83F.2070801@bigfoot.com> Date: Sat, 24 Jul 2004 02:07:27 +0200 From: Gaetano Mendola User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Matthew T. O'Connor" 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> <410154F9.3080500@zeut.net> In-Reply-To: <410154F9.3080500@zeut.net> 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/160 X-Sequence-Number: 7551 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matthew T. O'Connor wrote: | 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. Well I think pg_autovacuum as is in 7.4 can not help me for this particular table. The table have 4.8 milions rows and I have for that table almost 10252 new entries for day. I'm using pg_autovacuum with -a 200 -A 0.8 this means a threashold for that table equal to: 3849008 and if I understod well the way pg_autovacuum works this means have an analyze each 375 days, and I need an analyze for each day, at least. So I think is better for me put an analyze for that table in the cron. Am I wrong ? Regards Gaetano Mendola -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBAag87UpzwH2SGd4RAqb1AJ416ioVEY5T/dqnAQsaaqqoWcU3ZACghzsO 4xMowWp/MM8+i7DhoRO4018= =/gNn -----END PGP SIGNATURE-----