git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1601830)
Add vacuum_delay_point call in compute_index_stats's per-sample-row loop.
2015年3月29日 19:04:09 +0000 (15:04 -0400)
2015年3月29日 19:04:09 +0000 (15:04 -0400)
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.


diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 366c4af27fa0d1bf42b6a04171019b318f9035cb..d4d19148e5736ae7e1c5f04b3b7a91b2cd4ea326 100644 (file)
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -742,6 +742,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.
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /