Re: Why would this slow the query down so much?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Why would this slow the query down so much?
Date: 2001-10-15 15:12:36
Message-ID: 14373.1003158756@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Stuart Grimshaw <nospam(at)smgsystems(dot)co(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-10-15 15:13:11 Re: SQL reference card
Previous Message Szabo Zoltan 2001-10-15 14:05:16 Re: to_char()??