pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ian Cass <ian.cass@mblox.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: JOINS and non use of indexes
Date: Mon, 08 Apr 2002 11:21:57 -0400
Message-ID: <21034.1018279317@sss.pgh.pa.us> (raw)
In-Reply-To: <00d401c1df0f$d445c410$6602a8c0@salamander>
References: <002001c1def9$e0fcc750$6602a8c0@salamander>
	<20623.1018277168@sss.pgh.pa.us>
	<00d401c1df0f$d445c410$6602a8c0@salamander>

"Ian Cass" <ian.cass@mblox.com> 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



view thread (8+ messages)

Message-ID: <21034.1018279317@sss.pgh.pa.us>
Permalink:  ../21034.1018279317@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21034.1018279317@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, ian.cass@mblox.com
  Subject: Re: JOINS and non use of indexes
  In-Reply-To: <21034.1018279317@sss.pgh.pa.us>

* 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