Re: BUG #19037: Planner fails on estimating array length with "no relation entry" error
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2025-09-01T07:32:43Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix planner error when estimating SubPlan cost
- 8c02d92c6475 13.23 landed
- 160ef51c8dba 14.20 landed
- 53e35fb560ab 15.15 landed
- 79ade5873232 16.11 landed
- f34202f51867 17.7 landed
- ab4a35b4ea9d 18.0 landed
- aba8f61c3091 19 (unreleased) landed
On Sun, Aug 31, 2025 at 6:51 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > The most expedient solution is probably to hack examine_variable > so that it doesn't fail if root->simple_rel_array isn't there yet. > That seems mighty ugly though. As an alternative, I wonder if we could pass root as NULL to cost_subplan() when it's called from build_subplan(), and possibly also from SS_process_ctes(). At those points, the root does not yet contain enough information to safely consult statistics. Meanwhile, cost_qual_eval() and the functions it calls are already well-equipped to handle a NULL root. - Richard