Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 6E1529FBAA1 for ; Wed, 23 May 2007 20:56:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 27572-10 for ; Wed, 23 May 2007 20:55:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id F2EB09FBCBC for ; Wed, 23 May 2007 20:56:01 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l4NNtxt0026269; Wed, 23 May 2007 19:55:59 -0400 (EDT) To: Craig James cc: pgsql-performance@postgresql.org Subject: Re: Auto-ANALYZE? In-reply-to: <4654D26E.1020208@emolecules.com> References: <4654D26E.1020208@emolecules.com> Comments: In-reply-to Craig James message dated "Wed, 23 May 2007 16:46:54 -0700" Date: Wed, 23 May 2007 19:55:58 -0400 Message-ID: <26268.1179964558@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/472 X-Sequence-Number: 24862 Craig James writes: > Auto-vacuum has made Postgres a much more "friendly" system. Is there some reason the planner can't also auto-ANALYZE in some situations? autovacuum handles analyze too. Trying to make the planner do it is a crummy idea for a couple of reasons: * unpredictable performance if queries sometimes go off for a few seconds to collect stats * pg_statistics update requires semi-exclusive lock * work is lost if transaction later rolls back regards, tom lane