X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 008DFD1B51A for ; Wed, 1 Oct 2003 15:59:09 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 61607-08 for ; Wed, 1 Oct 2003 12:58:23 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id DDB4FD1B4F2 for ; Wed, 1 Oct 2003 12:58:22 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h91FwK6c029757; Wed, 1 Oct 2003 11:58:20 -0400 (EDT) To: "CN" Cc: pgsql-sql@postgresql.org Subject: Re: Creating Index In-reply-to: <20031001152542.8C9C76F692@smtp.us2.messagingengine.com> References: <20031001152542.8C9C76F692@smtp.us2.messagingengine.com> Comments: In-reply-to "CN" message dated "Wed, 01 Oct 2003 07:25:42 -0800" Date: Wed, 01 Oct 2003 11:58:20 -0400 Message-ID: <29756.1065023900@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/13 X-Sequence-Number: 15413 "CN" writes: > The following view is, again, a simplified version. The real version, > which takes 13 seconds, joins 2 more tables. You're really doing your best to make sure we don't figure out what's going on :-( One thing I can see from your EXPLAIN ANALYZE results, though, is that you've never VACUUMed or ANALYZEd these tables. If you had, there'd be something other than the default 1000-row table size estimates: > -> Index Scan using table1_pkey on table1 > (cost=0.00..52.00 rows=1000 width=100) > (actual time=0.69..220.87 rows=9428 loops=1) > -> Index Scan using table2_pkey on table2 > (cost=0.00..52.00 rows=1000 width=224) > (actual time=0.63..959.95 rows=28482 loops=1) and possibly the planner would have picked a more appropriate plan. regards, tom lane