Skip to content
Snippets Groups Projects
Commit d12afe11 authored by Tom Lane's avatar Tom Lane
Browse files

Add vacuum_delay_point call in compute_index_stats's per-sample-row loop.

Slow functions in index expressions might cause this loop to take long
enough to make it worth being cancellable.  Probably it would be enough
to call CHECK_FOR_INTERRUPTS here, but for consistency with other
per-sample-row loops in this file, let's use vacuum_delay_point.

Report and patch by Jeff Janes.  Back-patch to all supported branches.
parent e37c1090
No related branches found
No related tags found
No related merge requests found
...@@ -738,6 +738,8 @@ compute_index_stats(Relation onerel, double totalrows, ...@@ -738,6 +738,8 @@ compute_index_stats(Relation onerel, double totalrows,
{ {
HeapTuple heapTuple = rows[rowno]; HeapTuple heapTuple = rows[rowno];
vacuum_delay_point();
/* /*
* Reset the per-tuple context each time, to reclaim any cruft * Reset the per-tuple context each time, to reclaim any cruft
* left behind by evaluating the predicate or index expressions. * left behind by evaluating the predicate or index expressions.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment