[PERFORM] Propagating outer join conditions

2006-12-03 Thread Aaron Birkland
The following left outer join plan puzzles me: EXPLAIN ANALYZE SELECT * from t28 LEFT OUTER JOIN (t1 JOIN t11 ON (t11.o = 'http://example.org' AND t11.s = t1.o)) ON t28.s = t1.s WHERE t28.o = 'spec'; t28, t1, and t11 all have indexed columns named 's' and 'o' that contain 'text'; Nested Loop

Re: [PERFORM] Propagating outer join conditions

2006-12-03 Thread Jonathan Blitz
-Original Message- From: Aaron Birkland [mailto:[EMAIL PROTECTED] Sent: Sunday, December 03, 2006 5:12 PM To: pgsql-performance@postgresql.org Subject: [PERFORM] Propagating outer join conditions The following left outer join plan puzzles me: EXPLAIN ANALYZE SELECT * from t28 LEFT

Re: [PERFORM] Propagating outer join conditions

2006-12-03 Thread Aaron Birkland
First, I forgot to mention - this is 8.2 RC1 I was trying on The suggested change produces an identical 'bad' query plan. The main issue (I think) is that the query node that processes t1 JOIN t11 ON ..' is not aware of the join condition 't28.s = t1.s'.. even though the value of t28.s (as

Re: [PERFORM] Propagating outer join conditions

2006-12-03 Thread Tom Lane
Aaron Birkland [EMAIL PROTECTED] writes: ... Is is possible to generate a plan that looks like this: Nested Loop Left Join (cost=???) - Index Scan using t28_o on t28 (cost=0.00..9.11 rows=1 width=89) Index Cond: (o = 'spec'::text) - Nested Loop (cost=???) -