pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Zintrigue <zintrigue@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: noob inheritance question
Date: Thu, 7 Jan 2010 15:19:57 -0500
Message-ID: <603c8f071001071219n423913b6l435e6c227c831333@mail.gmail.com> (raw)
In-Reply-To: <22f7878e1001061553j69b3b461hadd4633c58c5304f@mail.gmail.com>
References: <22f7878e1001061553j69b3b461hadd4633c58c5304f@mail.gmail.com>

On Wed, Jan 6, 2010 at 6:53 PM, Zintrigue <zintrigue@gmail.com> wrote:
> I'm wondering if there's any performance penalty here

There definitely is.  Your design sounds pretty painful to me...
adding a column referencing a side-table will be much nicer.

> If anyone can offer in any insight as too how inheritance is actually
> executed (compared to JOINs especially), I'd be most grateful.

You can look at the query plans for your queries using EXPLAIN.
Inheritance is really just UNION ALL under the covers - it's meant for
partitioning, not the sort of thing you're trying to do here, so your
query plans will probably not be too good with this design.

...Robert



view thread (5+ messages)

Message-ID: <603c8f071001071219n423913b6l435e6c227c831333@mail.gmail.com>
Permalink:  ../603c8f071001071219n423913b6l435e6c227c831333@mail.gmail.com/
Also on:    postgresql.org/message-id/603c8f071001071219n423913b6l435e6c227c831333@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: robertmhaas@gmail.com, zintrigue@gmail.com
  Subject: Re: noob inheritance question
  In-Reply-To: <603c8f071001071219n423913b6l435e6c227c831333@mail.gmail.com>
  References: <22f7878e1001061553j69b3b461hadd4633c58c5304f@mail.gmail.com> <603c8f071001071219n423913b6l435e6c227c831333@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox