Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id E9C7B47608F for ; Mon, 8 Apr 2002 11:21:24 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g38FLvF21037; Mon, 8 Apr 2002 11:21:57 -0400 (EDT) To: "Ian Cass" Cc: pgsql-sql@postgresql.org Subject: Re: JOINS and non use of indexes In-reply-to: <00d401c1df0f$d445c410$6602a8c0@salamander> References: <002001c1def9$e0fcc750$6602a8c0@salamander> <20623.1018277168@sss.pgh.pa.us> <00d401c1df0f$d445c410$6602a8c0@salamander> Comments: In-reply-to "Ian Cass" message dated "Mon, 08 Apr 2002 16:12:36 +0100" Date: Mon, 08 Apr 2002 11:21:57 -0400 Message-ID: <21034.1018279317@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/90 X-Sequence-Number: 7355 "Ian Cass" writes: >> The planner isn't smart about >> indexscan-based joins for inheritance trees. This could possibly be >> improved with some work, but I haven't thought about the details. > Is there any way I could 'educate' it by using more explicit sql, or do I > have to abandon the idea of using inheritance altogether? You'd have to spell out the join for each member of the inheritance tree: SELECT ... FROM outside, inside_1 WHERE ... UNION ALL SELECT ... FROM outside, inside_2 WHERE ... UNION ALL SELECT ... FROM outside, inside_3 WHERE ... which is just about as bad as not using inheritance :-( regards, tom lane