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 > > -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general