Re: explicit JOIN faster than implicit?

From: Eric Schwarzenbach <Eric(dot)J(dot)Schwarzenbach(dot)C88(at)alumni(dot)upenn(dot)edu>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: explicit JOIN faster than implicit?
Date: 2009-08-05 22:14:20
Message-ID: 4A7A043C.1070106@alumni.upenn.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ivan Voras 2009-08-05 22:34:06 PREPARE query with IN?
Previous Message Eric Schwarzenbach 2009-08-05 22:04:24 Re: explicit JOIN faster than implicit?