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

Re: A question about inheritance

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: li li <lili(at)cs(dot)uoregon(dot)edu>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: A question about inheritance
Date: 2002-12-31 01:42:49
Message-ID: (view raw or whole thread)
Lists: pgsql-performance
On Sun, 2002-12-29 at 22:09, li li wrote:
> Hi,
>    As we can see all tuples of a child table when scanning parent table,
> I'm confused about if that means there are two copies that are stored on
> disk, one is for child table, and the other for parent table? If so,
> I have to reconsider the size of my database.

When you select from the parent table, all rows in its children are also
selected unless you use the keyword ONLY.


  SELECT * FROM parent;

will show all rows of parent and children. But

  SELECT * FROM ONLY parent;

will show just the rows in the parent table.

Oliver Elphick                                Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK                   
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
     "Ye have heard that it hath been said, Thou shalt love 
      thy neighbour, and hate thine enemy. But I say unto 
      you, Love your enemies, bless them that curse you, do 
      good to them that hate you, and pray for them which 
      despitefully use you, and persecute you;"          
                                     Matthew 5:43,44 

In response to

pgsql-performance by date

Next:From: Michael TeterDate: 2002-12-31 22:14:34
Subject: preliminary testing, two very slow situations...
Previous:From: li liDate: 2002-12-29 22:09:10
Subject: A question about inheritance

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