Re: should check interrupts in BuildRelationExtStatistics ?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Tomas Vondra <tomas.vondra@enterprisedb.com>, pgsql-hackers@postgresql.org
Date: 2022-05-09T03:36:33Z
Lists: pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> How long can the backend remain unresponsive?  I don't think that
> anybody would object to the addition of some CHECK_FOR_INTERRUPTS() in
> areas where it would be efficient to make the shutdown quicker, but
> we need to think carefully about the places where we'd want to add
> these.

CHECK_FOR_INTERRUPTS is really quite cheap, just a test-and-branch.
I wouldn't put it in a *very* tight loop, but one test per row
processed while gathering stats is unlikely to be a problem.

			regards, tom lane



Commits

  1. Invent qsort_interruptible().