On 10/15/18, Amit Kapila <amit.kapila16@gmail.com> wrote:
> I think you can avoid calling RelationGetNumberOfBlocks, if you call
> smgrexists before
This is done in the attached v5, 0001.
> and for the purpose of vacuum, we can get that as an
> input parameter. I think one can argue for not changing the interface
> functions like RecordPageWithFreeSpace to avoid calling
> RelationGetNumberOfBlocks, but to me, it appears worth to save the
> additional system call.
This is done in 0002. I also added a check for the cached value of
pg_class.relpages, since it's cheap and may help non-VACUUM callers.
> [proposal for a cache of blocks to try]
That's interesting. I'll have to do some reading elsewhere in the
codebase, and then I'll follow up.
Thanks,
-John Naylor