Cache smgrnblocks() results in recovery.
Thomas Munro <tmunro@postgresql.org>
Cache smgrnblocks() results in recovery. Avoid repeatedly calling lseek(SEEK_END) during recovery by caching the size of each fork. For now, we can't use the same technique in other processes, because we lack a shared invalidation mechanism. Do this by generalizing the pre-existing caching used by FSM and VM to support all forks. Discussion: https://postgr.es/m/CAEepm%3D3SSw-Ty1DFcK%3D1rU-K6GSzYzfdD4d%2BZwapdN7dTa6%3DnQ%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_visibility/pg_visibility.c | modified | +1 −1 |
| src/backend/access/heap/visibilitymap.c | modified | +8 −10 |
| src/backend/catalog/storage.c | modified | +2 −2 |
| src/backend/storage/freespace/freespace.c | modified | +14 −13 |
| src/backend/storage/smgr/smgr.c | modified | +36 −13 |
| src/include/storage/smgr.h | modified | +5 −7 |
Discussion
- Cache relation sizes? 56 messages · 2018-11-06 → 2021-07-14