Re: Query plan optimization for CHECK NO INHERIT and single table?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Matthias <nitrogenycs(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Query plan optimization for CHECK NO INHERIT and single table?
Date: 2012-08-30 13:46:57
Message-ID: CA+Tgmobe3B41e00CEtSNw8L0j2im+jVun_NPcU2a_9Dt5AjGCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 30, 2012 at 2:00 AM, Matthias <nitrogenycs(at)gmail(dot)com> wrote:
> Hey,
>
> I tried out the new CHECK NO INHERIT feature for inherited tables.
> There seems to be an opportunity to generate slightly better query
> plans sometimes. E.g. when I do
>
> SELECT * FROM base WHERE partition_id = 3
>
> and there exists only one child table for which partition_id = 3 is
> true I guess the query plan could just do a seq/index/whatever scan on
> that table. Right now the query plan has an intermediate "Append"
> node. This seems only useful if the results of multiple child tables
> would need to be included.

I think it's needed to translate between the child's set of attribute
numbers and their parent's set of attribute numbers - that is, the
child could have the columns in a different order, or could have extra
ones.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-08-30 14:05:04 Re: Chronic performance issue with Replication Failover and FSM.
Previous Message Robert Haas 2012-08-30 13:44:07 Re: wal_buffers