Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3FBD2B5D8B2 for ; Thu, 12 May 2011 17:16:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 47987-08 for ; Thu, 12 May 2011 20:16:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 162CAB5D803 for ; Thu, 12 May 2011 17:16:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p4CKGIpr008491; Thu, 12 May 2011 16:16:18 -0400 (EDT) To: Greg Smith cc: Tomas Vondra , pgsql-performance@postgresql.org Subject: Re: since when has pg_stat_user_indexes.idx_scan been counting? In-reply-to: <4DCC3DD9.4000402@2ndquadrant.com> References: <4DCC24BD.9040900@fuzzy.cz> <4DCC3DD9.4000402@2ndquadrant.com> Comments: In-reply-to Greg Smith message dated "Thu, 12 May 2011 16:06:49 -0400" Date: Thu, 12 May 2011 16:16:18 -0400 Message-ID: <8490.1305231378@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/189 X-Sequence-Number: 43698 Greg Smith writes: > You're saying to watch out for (3); I think that's not usually the case, > but that's a fair thing to warn about. Even in that case, though, it > may still be worth dropping the index. Year-end processes are not > usually very sensitive to whether they take a little or a long time to > execute. But you will be paying to maintain the index every day while > it is there. Yeah. Another idea worth considering is to have the year-end processing build the index it wants, use it, drop it. It seems unlikely that it's worth maintaining an index year-round for such infrequent usage. regards, tom lane