Re: INNER JOIN ON vs ','+WHERE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thalis A(dot) Kalfigopoulos" <thalis(at)cs(dot)pitt(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: INNER JOIN ON vs ','+WHERE
Date: 2001-06-25 18:40:39
Message-ID: 16882.993494439@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Thalis A. Kalfigopoulos" <thalis(at)cs(dot)pitt(dot)edu> writes:
> Changing the type of "join" syntax affects the plan-generation time
> and the execution-time. Would it be logical to EXPLAIN the query once
> using the 'FROM a,b,c WHERE...' syntax and then assuming that it
> returns the optimal execution plan, use the join order of this plan to
> rewrite the query in a 'a INNER JOIN b ON ... INNER JOIN c ON...'
> fashion so as to save the plan generation time from then on?

Yup, that's more or less what the documentation is trying to suggest,
down at the bottom.

> Is the plan generation time significant compared to actual execution
> time when we are talking about large tables even if there's lots of
> them? The question actually is: is there any more time involved to
> plan generation other than what it takes when I do an EXPLAIN on the
> query? After that, all time is consumed to performing the actual
> joins, correct?

EXPLAIN runs the same planner as actual execution does. If EXPLAIN
doesn't take long enough to bother you, then you don't need to worry
about planning time.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Ploski 2001-06-25 18:42:59 PostgreSQL: YMMV?
Previous Message Thalis A. Kalfigopoulos 2001-06-25 18:35:47 Re: INNER JOIN ON vs ','+WHERE