Re: Idea for reducing planning time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Idea for reducing planning time
Date: 2000-12-15 19:06:43
Message-ID: 12895.976907203@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> My quick question is that if we have a1=b1 and b1=c1, isn't the join
> sorted by a1, b1, and c1, and threfore we don't get more sorted plans?

That's not the issue. See, before the transitive-equality patch,
if you wrote

select * from a,b,c where a.x = b.y and b.y = c.z

then the system would not consider plans of the structure {a c} b
(ie, start with a join of a to c and then add b). It would only
consider {a b} c and {b c} a plans, because it follows join clauses
if any are available.

Now that we deduce the additional WHERE clause a.x = c.z, we will
also consider {a c} b. So we may get a better plan as a result ...
but whether we give back the same plan or not, it takes longer,
because more paths will be considered. Brian Hirt was unhappy because
planning was taking significantly longer on his seven-way join.

> Did you lose the argument with Vadim? I haven't seen his vacuum commit
> yet, though I certainly would like to. :-)

I'm assuming he's going to commit it, though I haven't seen him say so
in so many words.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-12-15 19:08:49 Re: Idea for reducing planning time
Previous Message Marc G. Fournier 2000-12-15 19:01:12 Re: Idea for reducing planning time