Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-14 Thread Robert Haas
On Tue, Jun 13, 2017 at 4:56 PM, Thomas Munro wrote: > On Wed, Jun 14, 2017 at 4:22 AM, Robert Haas wrote: >> I'm just trying to understand your comments so that I can have an >> intelligent opinion about what we should do from here. Given

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Thomas Munro
On Wed, Jun 14, 2017 at 4:22 AM, Robert Haas wrote: > I'm just trying to understand your comments so that I can have an > intelligent opinion about what we should do from here. Given that the > replan wouldn't happen anyway, there seems to be no reason to tinker > with the

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Robert Haas
On Tue, Jun 13, 2017 at 12:04 PM, Tom Lane wrote: > Robert Haas writes: >> On Tue, Jun 13, 2017 at 11:53 AM, Tom Lane wrote: >>> But it needs to be changeable, unless you like the proposition that we >>> can never replan a query

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Tom Lane
Robert Haas writes: > On Tue, Jun 13, 2017 at 11:53 AM, Tom Lane wrote: >> But it needs to be changeable, unless you like the proposition that we >> can never replan a query inside a trigger on the basis of new information >> about how big the

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Robert Haas
On Tue, Jun 13, 2017 at 11:53 AM, Tom Lane wrote: >> How does it break those properties? I don't think enrtuples is being >> modified by planning or execution as things stand. > > But it needs to be changeable, unless you like the proposition that we > can never replan a

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Tom Lane
Robert Haas writes: > On Tue, Jun 13, 2017 at 10:05 AM, Tom Lane wrote: >> Well, the fundamental problem is that the RTE is a lousy place to keep >> rowcount estimates. That breaks assorted desirable properties like >> querytrees being readonly to

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Robert Haas
On Tue, Jun 13, 2017 at 10:05 AM, Tom Lane wrote: > Robert Haas writes: >> Perhaps this is a silly question, but I don't particularly see what's >> wrong with: > >> 3. Do nothing. > > Well, the fundamental problem is that the RTE is a lousy place to

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Tom Lane
Robert Haas writes: > Perhaps this is a silly question, but I don't particularly see what's > wrong with: > 3. Do nothing. Well, the fundamental problem is that the RTE is a lousy place to keep rowcount estimates. That breaks assorted desirable properties like querytrees

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Robert Haas
On Mon, Jun 12, 2017 at 12:04 AM, Thomas Munro wrote: > Here are a couple of ways forward that I can see: > > 1. Figure out how to get the QueryEnvironment through more of these > stack frames (possibly inside other objects), so that >

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Thomas Munro
On Tue, Jun 13, 2017 at 6:40 PM, Noah Misch wrote: > On Mon, Jun 12, 2017 at 04:04:23PM +1200, Thomas Munro wrote: >> On Sun, Jun 11, 2017 at 11:11 PM, Thomas Munro >> wrote: >> > On Sun, Jun 11, 2017 at 6:25 PM, Noah Misch

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-13 Thread Noah Misch
On Mon, Jun 12, 2017 at 04:04:23PM +1200, Thomas Munro wrote: > On Sun, Jun 11, 2017 at 11:11 PM, Thomas Munro > wrote: > > On Sun, Jun 11, 2017 at 6:25 PM, Noah Misch wrote: > >> This fourth point is not necessarily a defect: I wonder if

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-11 Thread Thomas Munro
On Sun, Jun 11, 2017 at 11:11 PM, Thomas Munro wrote: > On Sun, Jun 11, 2017 at 6:25 PM, Noah Misch wrote: >> This fourth point is not necessarily a defect: I wonder if RangeTblEntry is >> the right place for enrtuples. It's a concept regularly

Re: [HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-11 Thread Thomas Munro
On Sun, Jun 11, 2017 at 6:25 PM, Noah Misch wrote: > While completing my annual src/backend/nodes/*funcs.c audit, I noticed defects > in commit 18ce3a4 changes to RangeTblEntry: > > 1. Field relid is under a comment saying it is valid for RTE_RELATION only. The comment is out

[HACKERS] RTE_NAMEDTUPLESTORE, enrtuples and comments

2017-06-11 Thread Noah Misch
While completing my annual src/backend/nodes/*funcs.c audit, I noticed defects in commit 18ce3a4 changes to RangeTblEntry: 1. Field relid is under a comment saying it is valid for RTE_RELATION only. Fields coltypes, coltypmods and colcollations are under a comment saying they are valid for