X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BB9F69DC9C7 for ; Mon, 27 Mar 2006 18:42:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91939-08 for ; Mon, 27 Mar 2006 18:42:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from outbound.mailhop.org (outbound.mailhop.org [63.208.196.171]) by postgresql.org (Postfix) with ESMTP id BF9959DC863 for ; Mon, 27 Mar 2006 18:42:39 -0400 (AST) Received: from ool-4350c8e6.dyn.optonline.net ([67.80.200.230] helo=[192.168.0.96]) by outbound.mailhop.org with esmtpa (Exim 4.51) id 1FO0Q6-0006b1-1u; Mon, 27 Mar 2006 17:42:42 -0500 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 67.80.200.230 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: zeut Message-ID: <44286A76.5010008@zeut.net> Date: Mon, 27 Mar 2006 17:43:02 -0500 From: "Matthew T. O'Connor" User-Agent: Thunderbird 1.4 (Windows/20050908) MIME-Version: 1.0 To: Mikael Carneholm CC: Postgresql Performance Subject: Re: count(*) performance References: <7F10D26ECFA1FB458B89C5B4B0D72C2B088295@sesrv12.wirelesscar.com> In-Reply-To: <7F10D26ECFA1FB458B89C5B4B0D72C2B088295@sesrv12.wirelesscar.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.127 required=5 tests=[AWL=0.127] X-Spam-Score: 0.127 X-Spam-Level: X-Archive-Number: 200603/534 X-Sequence-Number: 17971 Mikael Carneholm wrote: > This is where a "last_vacuumed" (and "last_analyzed") column in > pg_statistic(?) would come in handy. Each time vacuum or analyze has > finished, update the row for the specific table that was > vacuumed/analyzed with a timestamp in the last_vacuumed/last_analyzed > column. No more guessing "maybe I haven't vacuumed/analyzed in a while", > and each time a user complains about bad performance, one could request > the user to do a "select s.last_vacuumed, s.last_analyzed from > pg_statistic s, pg_attribute a, pg_class c where ..." > > It SOUNDS easy to implement, but that has fooled me before... :-) It is fairly easy to implement, however it has been discussed before and decided that it wasn't necessary. What the system cares about is how long it's been since the last vacuum in terms of XIDs not time. Storing a timestamp would make it more human readable, but I'm not sure the powers that be want to add two new columns to some system table to accommodate this. Matt