Re: What gets inherited - Mailing list pgsql-novice

From John Taylor
Subject Re: What gets inherited
Date
Msg-id 02061817475504.01632@splash.hq.jtresponse.co.uk
Whole thread Raw
In response to What gets inherited  (John Taylor <postgres@jtresponse.co.uk>)
List pgsql-novice
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

pgsql-novice by date:

Previous
From: "Pierre-Alexis PAQUIN"
Date:
Subject: unsubscribe NOVICE
Next
From: Josh Berkus
Date:
Subject: Re: function delete problems