X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 44FB93A4DE2 for ; Sat, 22 Jan 2005 20:22:33 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94816-04 for ; Sat, 22 Jan 2005 20:22:24 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5696A3A4FBB for ; Sat, 22 Jan 2005 20:22:24 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j0MKMMVH024997; Sat, 22 Jan 2005 15:22:22 -0500 (EST) To: Greg Stark Cc: ken , pgsql-performance@postgresql.org Subject: Re: inheritance performance In-reply-to: <87hdlaahez.fsf@stark.xeocode.com> References: <1106295545.6622.266.camel@pesky.s6portland> <87hdlaahez.fsf@stark.xeocode.com> Comments: In-reply-to Greg Stark message dated "21 Jan 2005 11:14:12 -0500" Date: Sat, 22 Jan 2005 15:22:22 -0500 Message-ID: <24996.1106425342@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/414 X-Sequence-Number: 10104 Greg Stark writes: > ken writes: >> From my understanding, all the data for these columns in all the child >> tables will be stored in this one parent table > No, all the data is stored in the child table. Correct ... >> and that, furthermore, there is a "hidden" column in the parent table called >> tableoid that allows postgres to determine which row is stored in which >> child table. > That's true. > There's a performance hit for the extra space required to store the tableoid. Bzzzt ... tableoid isn't actually stored anywhere on disk. It's a pseudo-column that is generated during row fetch. (It works for all tables, not only inheritance children.) >> Given that, is there a performance hit for queries on the child tables >> because postgres has to effectively put a condition on every query based on >> the tableoid of the given child table? AFAIR, a query directed specifically to a child table is *completely* unaware of the fact that that table is a child. Only queries directed to a parent table, which have to implicitly UNION in the children, pay any price for inheritance. regards, tom lane