From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-sql@postgresql.org
Subject: Re: Why would this slow the query down so much?
Date: Mon, 15 Oct 2001 11:12:36 -0400
Message-ID: <14373.1003158756@sss.pgh.pa.us> (raw)
In-Reply-To: <xgXw7.2205$uU2.85101@wards>
References: <xgXw7.2205$uU2.85101@wards>
Stuart Grimshaw <nospam@smgsystems.co.uk> writes:
> SELECT a.category, b.headline, b.added, c.friendlyname
> FROM caturljoin as a
> INNER JOIN stories as b ON (a.url = b.source)
> INNER JOIN urllist as c ON (a.url = d.urn)
> WHERE a.category = 93 ORDER BY b.added DESC LIMIT 1;
(I assume "d.urn" is a typo for "c.urn"...)
The query plan you show looks pretty reasonable if the planner's row
count estimates are in the right ballpark. How many caturljoin rows
have category = 93? How many stories rows will match each caturljoin
row? How many urllist rows ditto?
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
Subject: Re: Why would this slow the query down so much?
In-Reply-To: <14373.1003158756@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