]> granicus.if.org Git - postgresql/commit
Ensure that seqscans check for interrupts at least once per page.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 May 2012 23:42:28 +0000 (19:42 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 May 2012 23:42:28 +0000 (19:42 -0400)
commitc994b9211fd0cf7a5b680ae115330117604b9f7c
treea067e2fa987d01ab84c5c274bea9881b81e0f623
parent57615562504a3a10784d10a5205ed4bab41dba6e
Ensure that seqscans check for interrupts at least once per page.

If a seqscan encounters many consecutive pages containing only dead tuples,
it can remain in the loop in heapgettup for a long time, and there was no
CHECK_FOR_INTERRUPTS anywhere in that loop.  This meant there were
real-world situations where a query would be effectively uncancelable for
long stretches.  Add a check placed to occur once per page, which should be
enough to provide reasonable response time without adding any measurable
overhead.

Report and patch by Merlin Moncure (though I tweaked it a bit).
Back-patch to all supported branches.
src/backend/access/heap/heapam.c