omitting redundant join predicate - Mailing list pgsql-sql

From Ehab Galal
Subject omitting redundant join predicate
Date
Msg-id BAY138-W43A1A93DB7B84F57B84211968F0@phx.gbl
Whole thread Raw
Responses Re: omitting redundant join predicate
List 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!

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Scrolling cursors in PL/PgSQL
Next
From: Tom Lane
Date:
Subject: Re: omitting redundant join predicate