Re: Assertion failure with LEFT JOINs among >500 relations
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Onder Kalaci <onderk@microsoft.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-10-08T23:59:15Z
Lists: pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes: > I admit it's annoying to add cycles to clamp_row_est() for such insane cases. I poked at this a bit more closely, and noted that the actual problem is that when we do this: outer_skip_rows = rint(outer_path_rows * outerstartsel); we have outer_path_rows = inf, outerstartsel = 0, and of course inf times zero is NaN. So we end up asserting "NaN <= Inf", not "Inf <= Inf" (which wouldn't have caused a problem). If we did want to do something here, I'd consider something like if (isnan(outer_skip_rows)) outer_skip_rows = 0; if (isnan(inner_skip_rows)) inner_skip_rows = 0; (We shouldn't need that for outer_rows/inner_rows, since the endsel values can't be 0.) Messing with clamp_row_est would be a much more indirect way of fixing it, as well as having more widespread effects. In the end though, I'm still not terribly excited about this. regards, tom lane
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