From: Ehab Galal <ehabgalal123@hotmail.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: omitting redundant join predicate
Date: Sun, 4 Nov 2007 08:14:51 -0500
Message-ID: <BAY138-W43A1A93DB7B84F57B84211968F0@phx.gbl> (raw)
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=
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ehabgalal123@hotmail.com
Subject: Re: omitting redundant join predicate
In-Reply-To: <BAY138-W43A1A93DB7B84F57B84211968F0@phx.gbl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox