X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 182B6CC4E3 for ; Thu, 17 Jul 2003 18:50:54 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 81920-09 for ; Thu, 17 Jul 2003 18:51:11 +0000 (GMT) Received: from mta8.adelphia.net (mta8.adelphia.net [64.8.50.196]) by svr1.postgresql.org (Postfix) with ESMTP id 3CFBACC839 for ; Thu, 17 Jul 2003 15:50:41 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta8.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030717185111.YBVV27346.mta8.adelphia.net@potentialtech.com>; Thu, 17 Jul 2003 14:51:11 -0400 Message-ID: <3F16F01E.2040403@potentialtech.com> Date: Thu, 17 Jul 2003 14:51:10 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Relation of indices to ANALYZE References: <3F16B68F.7060207@potentialtech.com> <5740.1058466436@sss.pgh.pa.us> In-Reply-To: <5740.1058466436@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/275 X-Sequence-Number: 2568 Tom Lane wrote: > Bill Moran writes: > >>Specifically, I'm wondering if I should do >>the ANALYZE before or after I recreate the indexes, or whether it matters. > > > At the moment it does not matter --- ANALYZE computes statistics for > each column of a table regardless of what indexes exist. > > There has been some talk of trying to compute statistics for the > contents of functional indexes. Also, if we ever do anything about > computing multicolumn correlation statistics, we'd likely choose which > ones are worth computing based on the presence of multicolumn indexes. > So if you want to future-proof your code I'd recommend recreating the > indexes before you ANALYZE. Thanks, Tom (and everyone else who replied). I'm already recreating the indices prior to the VACUUM ANALYZE, since this puts the database back in a more usable state faster than doing the VACUUM first. It's good to know that it will probably be the proper way to do things in the future as well. -- Bill Moran Potential Technologies http://www.potentialtech.com