Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Phil Florent <philflorent(at)hotmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian
Date: 2018-07-16 05:48:54
Message-ID: CAKJS1f84sNmcPVpoScvdYz8HcCHOpnOh8KTKsYvYGHUqJp0mSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16 July 2018 at 16:56, Phil Florent <philflorent(at)hotmail(dot)com> wrote:

> I should post that in the general section but I am confused by the
> sentence "A parent partition is always going to have a lower relid than
> its children"
>

It's a little confusing since RelOptInfo has a relid field and so does
RangeTblEntry. They both have completely different meanings. RelOptInfo's
relid is a number starting at 1 and continues in a gapless sequence
increasing by 1 with each RelOptInfo. These relids are completely internal
to the server and don't appear in the system catalog tables.
RangeTblEntry's relid is what's in pg_class.oid.

I was talking about RelOptInfo's relid.

Using relids starting at 1 is quite convenient for allowing direct array
lookups in various data structures in the planner. However it's also
required to uniquely identify a relation as a single table may appear many
times in a query, so trying to identify them by their oid could be
ambiguous. Also, some RTEKinds don't have storage, e.g a VALUES() clause.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Khandekar 2018-07-16 06:36:24 Re: AtEOXact_ApplyLauncher() and subtransactions
Previous Message Phil Florent 2018-07-16 04:56:41 RE: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian