Re: Runtime pruning problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Yuzuko Hosoya <hosoya(dot)yuzuko(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Runtime pruning problem
Date: 2019-07-30 22:50:32
Message-ID: 7814.1564527032@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> writes:
> On Wed, 31 Jul 2019 at 10:27, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> What I had in mind was to revert 1cc29fe7c's ruleutils changes
>> entirely, so that ruleutils deals only in Plans not PlanStates.
>> Perhaps we've grown some code since then that really needs the
>> PlanStates, but what is that, and could we do it some other way?
>> I'm not thrilled with passing both of these around, especially
>> if the PlanState sometimes isn't there, meaning that no code in
>> ruleutils could safely assume it's there anyway.

> Are you not worried about the confusion that run-time pruning might
> cause if we always show the Vars from the first Append/MergeAppend
> plan node, even though the corresponding executor node might have been
> pruned?

The upper-level Vars should ideally be labeled with the append parent
rel's name anyway, no? I think it's likely *more* confusing if those
Vars change appearance depending on which partitions get pruned or not.

This may be arguing for a change in ruleutils' existing behavior,
not sure. But when dealing with traditional-style inheritance,
I've always thought that Vars above the Append were referring to
the parent rel in its capacity as the parent, not in its capacity
as the first child. With new-style partitioning drawing a clear
distinction between the parent and all its children, it's easier
to understand the difference.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-07-30 22:56:47 Re: Runtime pruning problem
Previous Message Daniel Migowski 2019-07-30 22:38:50 Re: Adding column "mem_usage" to view pg_prepared_statements