Re: JOINS and non use of indexes - Mailing list pgsql-sql

From Tom Lane
Subject Re: JOINS and non use of indexes
Date
Msg-id 21034.1018279317@sss.pgh.pa.us
Whole thread Raw
In response to Re: JOINS and non use of indexes  ("Ian Cass" <ian.cass@mblox.com>)
List pgsql-sql
"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 ALLSELECT ... FROM outside, inside_2 WHERE ...UNION ALLSELECT ... FROM
outside,inside_3 WHERE ...
 

which is just about as bad as not using inheritance :-(
        regards, tom lane


pgsql-sql by date:

Previous
From: "Ian Cass"
Date:
Subject: Re: JOINS and non use of indexes
Next
From: Søren Vainio
Date:
Subject: Scadinavian characters in regular expressions