Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 620B0B5DBE7 for ; Thu, 12 May 2011 15:19:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 40634-02 for ; Thu, 12 May 2011 18:19:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gransy.com (mail.gransy.com [82.208.29.194]) by mail.postgresql.org (Postfix) with ESMTP id 1D68FB5DBE4 for ; Thu, 12 May 2011 15:19:42 -0300 (ADT) Received: from [192.168.1.221] (ip-94-112-0-189.net.upcbroadband.cz [94.112.0.189]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id 9B78F4A21D9 for ; Thu, 12 May 2011 20:19:41 +0200 (CEST) Message-ID: <4DCC24BD.9040900@fuzzy.cz> Date: Thu, 12 May 2011 20:19:41 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101219 Lightning/1.0b3pre Thunderbird/3.1.7 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: since when has pg_stat_user_indexes.idx_scan been counting? References: In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/181 X-Sequence-Number: 43690 Dne 12.5.2011 17:39, Willy-Bas Loos napsal(a): > Hi, > > We have some indexes that don't seem to be used at all. > I'd like to know since when they have not been used. > That is, the time when postgres started counting to reach the number > that is in pg_stat_user_indexes.idx_scan > > Is there a way to retrieve that from the database ? BTW it's really really tricky to remove indexes once they're created. What if the index is created for a single batch process that runs once a year to close the fiscal year etc? So be very careful about this. Tomas