X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id CB19DCBB94 for ; Thu, 17 Jul 2003 18:26:47 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 92790-10 for ; Thu, 17 Jul 2003 18:27:16 +0000 (GMT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 64D5ACC8D0 for ; Thu, 17 Jul 2003 15:26:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h6HIRGQ3005741; Thu, 17 Jul 2003 14:27:16 -0400 (EDT) To: Bill Moran Cc: pgsql-performance@postgresql.org Subject: Re: Relation of indices to ANALYZE In-reply-to: <3F16B68F.7060207@potentialtech.com> References: <3F16B68F.7060207@potentialtech.com> Comments: In-reply-to Bill Moran message dated "Thu, 17 Jul 2003 10:45:35 -0400" Date: Thu, 17 Jul 2003 14:27:16 -0400 Message-ID: <5740.1058466436@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/273 X-Sequence-Number: 2566 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. regards, tom lane