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

From Eric Schwarzenbach
Subject Re: explicit JOIN faster than implicit?
Date
Msg-id 4A7A043C.1070106@alumni.upenn.edu
Whole thread Raw
In response to explicit JOIN faster than implicit?  (Eric Schwarzenbach <subscriber@blackbrook.org>)
Responses Re: explicit JOIN faster than implicit?  (Filip Rembiałkowski <plk.zuber@gmail.com>)
List pgsql-general
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.


Eric

Eric Schwarzenbach wrote:
> I'm in the process taking a large SELECT statement which had been
> written using implicit join syntax (that is, just listing all the tables
> in the FROM clause, and listing join conditions in the WHERE clause) and
> rewriting it to use explicit JOIN syntax (they are all inner joins).
> This has sped up the query by 50%.
>
> This is using Postgres 8.3 on a database with GEQO turned off.
>
> Is this what would be expected? Does the query planner / optimizer
> generally do better with explicit JOIN syntax?
>
> Cheers,
>
> Eric
>
>


pgsql-general by date:

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