Re: Assertion failure with LEFT JOINs among >500 relations
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Onder Kalaci <onderk@microsoft.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-10-08T23:27:21Z
Lists: pgsql-hackers
On Fri, 9 Oct 2020 at 12:16, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > > Perhaps the right fix is to modify clamp_row_est() with: > > I thought of that too, but as you say, if the rowcount has overflowed a > double then we've got way worse problems. It'd make more sense to try > to keep the count to a saner value in the first place. I wonder if there was something more logical we could do to maintain sane estimates too, but someone could surely still cause it to blow up by writing a long series of clause-less joins. We can't really get away from the fact that we must estimate those as inner_rows * outer_rows I admit it's annoying to add cycles to clamp_row_est() for such insane cases. David
Commits
-
Relax some asserts in merge join costing code
- 33a332bc1cff 13.1 landed
- 77ca44b76477 12.5 landed
- 2681bb230a68 11.10 landed
- 600c2412f850 10.15 landed
- 00fecc24c140 9.6.20 landed
- 3798b4fe73b9 9.5.24 landed
-
Prevent overly large and NaN row estimates in relations
- a90c950fc7fd 14.0 landed
-
Avoid a couple of zero-divide scenarios in the planner.
- 76281aa9647e 9.6.0 cited
-
Guard against incoming rowcount estimate of NaN in cost_mergejoin().
- 72826fb362c4 9.1.0 cited
-
When a relation has been proven empty by constraint exclusion, propagate that
- fd791e7b5a1b 8.4.0 cited