Skip site navigation (1) Skip section navigation (2)

Re: What gets inherited

From: John Taylor <postgres(at)jtresponse(dot)co(dot)uk>
To: "PgSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: What gets inherited
Date: 2002-06-18 16:47:55
Message-ID: 02061817475504.01632@splash.hq.jtresponse.co.uk (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-novice by date

Next:From: Josh BerkusDate: 2002-06-18 17:54:59
Subject: Re: function delete problems
Previous:From: Pierre-Alexis PAQUINDate: 2002-06-18 16:02:00
Subject: unsubscribe NOVICE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group