inheritance and index use (similar to UNION ALL) - Mailing list pgsql-general

From Karsten Hilbert
Subject inheritance and index use (similar to UNION ALL)
Date
Msg-id 20061210084334.GA4930@merkur.hilbert.loc
Whole thread Raw
Responses Re: inheritance and index use (similar to UNION ALL)  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-general
Hi,

we have a parent table root_item with a few common fields
(one is a text field) from which a whole bunch of child
tables derives.

We need to run queries against the text field across the
whole bunch of child tables. What naturally comes to mind is
to run the query against root_item.text_field thereby
catching all child table text_field values as well.

However, the planner doesn't really seem to consider indices
of the parent table. It was said that 8.2 would be making
improvements related to this and the Release Notes do have a
comment on planner improvements for UNION/inherited tables.
And, yes, the data does warrant using indices over using seq
scans. Explicitely joining the subtables one by one yields
orders of magnitude faster results (10 minutes going down to
2 seconds) and uses indices.

What I am wondering is:

 Should this really work (better) in 8.2 ?

 Do I need to provide more data (schema, explain plan etc) ?

 Am I doing something wrong (apart from perhaps chosing a
 non-performant schema design) ?

Thanks,
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: "surabhi.ahuja"
Date:
Subject: Re: installation problem, for Postgres 8.2.0
Next
From: Karsten Hilbert
Date:
Subject: Re: FW: Male/female