omitting redundant join predicate

From: Ehab Galal <ehabgalal123(at)hotmail(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: omitting redundant join predicate
Date: 2007-11-04 13:14:51
Message-ID: BAY138-W43A1A93DB7B84F57B84211968F0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I tried the following query

explain select *

from t1, t2, t3

where t1.f <= t2.f

and t2.f <= t3.f

and t1.f <= t3.f;

And that's what I got:

Nested Loop (cost=0.00..3.15 rows=1 width=368)

Join Filter:
(("outer".f <= "inner".f) AND ("inner".f <=
"outer".f))

-> Nested Loop (cost=0.00..2.10 rows=1 width=218)

Join Filter:
("outer".f <= "inner".f)

-> Seq Scan on t1 (cost=0.00..1.01 rows=1 width=146)

-> Seq Scan on t3 (cost=0.00..1.04 rows=4 width=72)

-> Seq Scan on t2 (cost=0.00..1.02 rows=2 width=150)

I was wondering if there is a
way to omit the redundant join predicate.

Thanks,

--h

_________________________________________________________________
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2007-11-04 16:35:36 Re: omitting redundant join predicate
Previous Message Tom Lane 2007-11-01 21:22:12 Re: Scrolling cursors in PL/PgSQL