Re: numbering plan nodes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: numbering plan nodes
Date
Msg-id 1761.1442521354@sss.pgh.pa.us
Whole thread Raw
In response to Re: numbering plan nodes  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: numbering plan nodes
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Sep 17, 2015 at 2:23 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I can't imagine I'd be doing anything that would break the simple case
>> of "give every node a distinct ID".  If you are building in weird
>> assumptions about traversal order, that might indeed be a problem.

> Good to know, thanks.  With the design you proposal above, we can make
> this insensitive to traversal order.  The only thing that would cause
> trouble is if you somehow ended up with massive gaps in the numbering
> sequence - e.g. if the final plan had 6 nodes, but the IDs were all 5
> digit numbers, you'd waste a silly amount of memory relative to the
> size of the plan.  But a few gaps (e.g. for removed SubqueryScan
> nodes) won't be a problem.

Hm ... if you quit worrying about the order-of-assignment, maybe you
could prevent gaps from removed SubqueryScan nodes by not giving them
IDs until after that decision is made?  Although it may not be worth
any extra trouble.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: On-demand running query plans using auto_explain and signals
Next
From: Michael Paquier
Date:
Subject: Re: some pg_rewind usability issues