Re: huge runtime difference between 2 almost identical queries (was: Re: Index Scans become Seq Scans after VACUUM ANALYSE)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Louis-David Mitterrand <vindex@apartia.org>
Cc: pgsql-hackers@postgresql.org
Date: 2002-04-17T16:14:47Z
Lists: pgsql-hackers
Louis-David Mitterrand <vindex@apartia.org> writes: > Hmm, since 7.1 released we have religiously converted all our joins to > the new syntax, thinking it more politically correct ;-). But now all > our beliefs are put into question. Back to old joins, in certain cases. > Here is the rule of thumb we deduct from your message: only use explicit > join syntax if a left|right|full join is involved OR if the > conditional(s) can go into the ON() clause, ELSE use the old join > syntax. I don't see that the ON clause has anything to do with it. You must use the JOIN syntax for any kind of outer join, of course. For an inner join, the planner currently has a better shot at choosing the right plan if you don't use JOIN syntax. See nearby thread for some discussion about tweaking this aspect of the planner's behavior. regards, tom lane