Re: explicit JOIN faster than implicit? - Mailing list pgsql-general

From Filip Rembiałkowski
Subject Re: explicit JOIN faster than implicit?
Date
Msg-id 92869e660908051617n4bc46829mec5cee9a9814269d@mail.gmail.com
Whole thread Raw
In response to Re: explicit JOIN faster than implicit?  (Eric Schwarzenbach <Eric.J.Schwarzenbach.C88@alumni.upenn.edu>)
List pgsql-general
Hi,

2009/8/6 Eric Schwarzenbach <Eric.J.Schwarzenbach.C88@alumni.upenn.edu>
I tried playing with the join_collapse_limit setting. The implicit join
query was unaffected. The explicit join out-performed the implicit one
by 50% when the join_collapse_limit  was low enough, and took just as
long as the implicit one when the join_collapse_limit was high enough.

If I'm reading the documentation right, when the join_collapse_limit is
high enough, the planner is rewriting my explicit join syntax into the
implicit join syntax...with the effect of slowing it down!

I'm not especially concerned, as the performance is acceptable either
way, and I'll be getting the better performance anyway, but I'm just
wondering if this behavior is expected.


Probably it's not expected, and definitely it is not desired :)
It would be helpful if you post explain analyze of both queries, before and after VACUM ANALYZE of all used tables.
You can also try to increase statistics target for join columns. Indexes might help too.


--
Filip Rembiałkowski
JID,mailto:filip.rembialkowski@gmail.com
http://filip.rembialkowski.net/

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: explicit JOIN faster than implicit?
Next
From: Ivan Voras
Date:
Subject: Re: PREPARE query with IN?