What gets inherited
What gets inherited
От:
John Taylor <postgres@jtresponse.co.uk>
Дата:
Hi, If I create a table that inherits from another, it inherits all the attributes, but does not appear to inherit the constraints, or indexes Can anyone give me a pointer to details of what does and does not get inherited. Thanks JohnT
Re: What gets inherited
От:
John Taylor <postgres@jtresponse.co.uk>
Дата:
On Tuesday 18 June 2002 16:45, I wrote:
> On Tuesday 18 June 2002 16:19, I wrote:
> > Hi,
> >
> > If I create a table that inherits from another, it inherits all the attributes,
> > but does not appear to inherit the constraints, or indexes
> >
>
> Just double checked.
> It seems that indexes DO get inherited, but I'm not sure about the rest.
> (I don't think I had enough rows for the optimizer to kick in indexed searches before)
>
Nope - thats not it....
john=# create index parent_value on parent(value);
CREATE
john=# explain select * from parent where value='foo';
NOTICE: QUERY PLAN:
Result (cost=0.00..30.64 rows=20 width=24)
-> Append (cost=0.00..30.64 rows=20 width=24)
-> Index Scan using parent_value on parent (cost=0.00..8.14 rows=10 width=24)
-> Seq Scan on child parent (cost=0.00..22.50 rows=10 width=24)
EXPLAIN
...
Now I'm really confused.
Can someone explain what is really going on !
Thanks
JohnT
Re: What gets inherited
От:
John Taylor <john.taylor@jtresponse.co.uk>
Дата:
On Tuesday 18 June 2002 16:19, I wrote:
> Hi,
>
> If I create a table that inherits from another, it inherits all the attributes,
> but does not appear to inherit the constraints, or indexes
>
Just double checked.
It seems that indexes DO get inherited, but I'm not sure about the rest.
(I don't think I had enough rows for the optimizer to kick in indexed searches before)
Regards
JohnT
--
John Taylor J T Response Limited
Director Internet Solutions for Business
+44 (0)1954 261146