From: Tom Lane <tgl@sss.pgh.pa.us>
To: CN <cnliou9@fastmail.fm>
Cc: pgsql-sql@postgresql.org
Subject: Re: Creating Index
Date: Wed, 01 Oct 2003 11:58:20 -0400
Message-ID: <29756.1065023900@sss.pgh.pa.us> (raw)
In-Reply-To: <20031001152542.8C9C76F692@smtp.us2.messagingengine.com>
References: <Pine.LNX.4.44.0310011419060.2932-100000@peter.localdomain>
<20031001152542.8C9C76F692@smtp.us2.messagingengine.com>
"CN" <cnliou9@fastmail.fm> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, cnliou9@fastmail.fm
Subject: Re: Creating Index
In-Reply-To: <29756.1065023900@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox