diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-03-29 15:04:09 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-03-29 15:04:33 -0400 |
commit | ab02d35e08274f2c1084e00e5106e72863a6c85b (patch) | |
tree | e3fc36b740bc7e5c483e64f381ac3e85746fb514 | |
parent | 054723bcc5b03e40d6341b26b2dce5222a66ce4c (diff) | |
download | postgresql-ab02d35e08274f2c1084e00e5106e72863a6c85b.tar.gz postgresql-ab02d35e08274f2c1084e00e5106e72863a6c85b.zip |
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.
-rw-r--r-- | src/backend/commands/analyze.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 0e876904d96..53fded17953 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -693,6 +693,8 @@ compute_index_stats(Relation onerel, double totalrows, { HeapTuple heapTuple = rows[rowno]; + vacuum_delay_point(); + /* * Reset the per-tuple context each time, to reclaim any cruft * left behind by evaluating the predicate or index expressions. |