Re: [SQL] (Ab)Using schemas and inheritance - Mailing list pgsql-general

From Jorge Godoy
Subject Re: [SQL] (Ab)Using schemas and inheritance
Date
Msg-id 200605241456.45645.jgodoy@gmail.com
Whole thread Raw
In response to Re: [SQL] (Ab)Using schemas and inheritance  (Richard Broersma Jr <rabroersma@yahoo.com>)
List pgsql-general
Em Quarta 24 Maio 2006 14:48, Richard Broersma Jr escreveu:
>
> From what I've read I am not sure that an Index created on the base/parent
> table will help when preforming select queries on data across all of the
> children.  If I interpret the "Caveats" correctly I would assume that the
> index will only apply to data that is inserted directly into the
> base/parent table.

It won't.  What I was saying is that I don't need an index just for this
reason because data partitioning would be intrinsic to the inheritance
solution.  I was thinking as described in
http://www.postgresql.org/docs/8.1/interactive/ddl-partitioning.html
(please, see 5.9.2, specially).

With his solution I'd need an index to have this partitioning implemented and
I'd suffer without it.  With inheritance I just need this index if I'm
actually operating with dates, not to just retrieve the right data for a
given year (whatever that means ;-)).

> From the Manual:
>
> 5.8.1. Caveats
>
> ...
>
> A serious limitation of the inheritance feature is that indexes (including
> unique constraints) and foreign key constraints only apply to single
> tables, not to their inheritance children. This is true on both the
> referencing and referenced sides of a foreign key constraint.

This is why, in one of the messages, I've said that I'd have to create indices
for children tables.  But hey, it is nice that you're also helping us
here :-)  Thanks! :-)

--
Jorge Godoy      <jgodoy@gmail.com>


pgsql-general by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: [SQL] (Ab)Using schemas and inheritance
Next
From: Tom Lane
Date:
Subject: Re: challenging constraint situation - how do I make it