Re: huge runtime difference between 2 almost identical queries (was: Re: Index Scans become Seq Scans after VACUUM ANALYSE)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Louis-David Mitterrand <vindex(at)apartia(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: huge runtime difference between 2 almost identical queries (was: Re: Index Scans become Seq Scans after VACUUM ANALYSE)
Date: 2002-04-17 16:14:47
Message-ID: 7056.1019060087@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Louis-David Mitterrand <vindex(at)apartia(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message mlw 2002-04-17 16:35:13 Re: Index Scans become Seq Scans after VACUUM ANALYSE
Previous Message Tom Lane 2002-04-17 16:10:28 Re: Index Scans become Seq Scans after VACUUM ANALYSE