I wrote: > Pavan Deolasee <pavan.deola...@gmail.com> writes: >> What if we remember the buffers as seen by count_nondeletable_pages() and >> then just discard those specific buffers instead of scanning the entire >> shared_buffers again?
> That's an idea. BTW, before pushing too hard on any of this, we need to think about the data-corruption hazard that MauMau just reminded us about. I'm afraid what we're likely to end up with after the dust settles is worse performance than today, not better :-(. https://postgr.es/m/5BBC590AE8DF4ED1A170E4D48F1B53AC@tunaPC regards, tom lane