postgres.git / summary / log / commit / refs

commit    152c94632f1ece90fccc87ff1fabe809a89e3024
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Sun Mar 29 19:04:09 2015 +0000
First released in: 9.5.0, 9.0.20, 9.1.16, 9.2.11, 9.3.7, 9.4.2

    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.


src/backend/commands/analyze.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index b34eebe01b8..e74bb1678c0 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -679,6 +679,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. [parent: 6997f226f5de]