Re: Damage control for planner's get_actual_variable_endpoint() runaway
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Simon Riggs <simon.riggs@enterprisedb.com>,
Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org, Jakub Wartak <jakub.wartak@enterprisedb.com>,
Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-11-22T18:22:31Z
Lists: pgsql-hackers
On Tue, Nov 22, 2022 at 11:35 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > Simon Riggs <simon.riggs@enterprisedb.com> writes: > > New patch version reporting for duty, sir. Please take it from here! > > Why the CHECK_FOR_INTERRUPTS? I'd supposed that there's going to be > one somewhere down inside the index or heap access --- do you have > reason to think there isn't? > > Is it appropriate to count distinct pages, rather than just the > number of times we have to visit a heap tuple? That seems to > complicate the logic a good deal, and I'm not sure it's buying > much, especially since (as you noted) it's imprecise anyway. FWW, the same question also occurred to me. But after mulling it over, what Simon did seems kinda reasonable to me. Although it's imprecise, it will generally cause us to stop sooner if we're bouncing all over the heap and be willing to explore further if we're just hitting the same heap page. I feel like that's pretty reasonable behavior. Stopping early could hurt, so if we know that continuing isn't costing much, why not? -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
YA attempt at taming worst-case behavior of get_actual_variable_range.
- b96a096dbc2b 11.19 landed
- ec10b6139c6d 12.14 landed
- bd06fe4dee63 14.7 landed
- 6e639267a534 13.10 landed
- 2debceed2947 15.2 landed
- 9c6ad5eaa957 16.0 landed
-
Improve performance of get_actual_variable_range with recently-dead tuples.
- 3ca930fc39cc 11.0 cited
-
Use SnapshotDirty rather than an active snapshot to probe index endpoints.
- fccebe421d0c 9.4.0 cited