Amit Kapila <amit.kapil...@gmail.com> writes: > On Sat, Aug 1, 2020 at 1:53 AM Andres Freund <and...@anarazel.de> wrote: >> We could also just use pg_class.relpages. It'll probably mostly be >> accurate enough?
> Don't we need the accurate 'number of blocks' if we want to invalidate > all the buffers? Basically, I think we need to perform BufTableLookup > for all the blocks in the relation and then Invalidate all buffers. Yeah, there is no room for "good enough" here. If a dirty buffer remains in the system, the checkpointer will eventually try to flush it, and fail (because there's no file to write it to), and then checkpointing will be stuck. So we cannot afford to risk missing any buffers. regards, tom lane