Joins and their efficiencies

From: Hadley Willan <hadley(dot)willan(at)deeperdesign(dot)co(dot)nz>
To: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Joins and their efficiencies
Date: 2003-04-02 20:39:37
Message-ID: 1049315977.1677.80.camel@atlas.sol.deeper.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,
I was doing a query yesterday, and implemented it two ways to see if
there was a difference. The first was the more standard way of doing the
query, by specifying the tables, and then linking them with AND x.id =
y.object etc..... I ran this and there seemed to be a momentary pause of
around one to one-half seconds before the result set returned. I decided
to try the same query again, but this time using, LEFT JOIN to bring in
the extra tables I wanted, it still had a few ANDs in there but only
about half as much. I ran the query and the ResultSet returned
instantly!

Is it correct then to assume that a LEFT JOIN is more efficient than a
straight join?

Thanks.
--
Hadley Willan > Systems Development > Deeper Design Limited. +64(7)377-3328
hadley(dot)willan(at)deeperdesign(dot)co(dot)nz > www.deeperdesign.com > +64(21)-28-41-463
Level 1, 4 Tamamutu St, PO Box 90, TAUPO 2730, New Zealand.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-04-02 20:55:46 Re: this date format thing.
Previous Message scott.marlowe 2003-04-02 20:23:45 this date format thing.