Re: RTE_NAMEDTUPLESTORE, enrtuples and comments
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Noah Misch <noah@leadboat.com>, Kevin Grittner <kgrittn@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>,
Andrew Gierth <andrew@tao11.riddles.org.uk>
Date: 2017-06-13T12:09:08Z
Lists: pgsql-hackers
On Mon, Jun 12, 2017 at 12:04 AM, Thomas Munro <thomas.munro@enterprisedb.com> 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 > set_namedtuplestore_size_estimates can look up enrtuples by enrname: If you were going to do this, the thing to do would be to get it hooked up to the PlannerInfo, possibly via an intermediate hop in the Query. > 2. Rip the row estimation out for now, use a bogus hard coded > estimate like we do in some other cases, and revisit later. See > attached (including changes from my previous message). > Unsurprisingly, a query plan changes. Perhaps this is a silly question, but I don't particularly see what's wrong with: 3. Do nothing. If I understand correctly, for the current use of named tuplestores, the existing code produces correct estimates. If we chose option #1, that would still be true, but we'd have to change a bunch of code to get there. If we chose option #2, it would cease to be true. Why not just leave it alone? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Fix problems related to RangeTblEntry members enrname and enrtuples.
- f32d57fd7088 10.0 landed
-
Add infrastructure to support EphemeralNamedRelation references.
- 18ce3a4ab22d 10.0 cited