Tweak mdnblocks() to avoid doing lseek() on segments that it has
previously determined not to be the last segment of a relation. This reduces the expected cost to one seek, rather than one seek per segment. We can get away with this because truncation of a relation will cause a relcache flush and so the md.c file descriptor will be closed; when it is re-opened we will re-determine the last segment.
Showing
Please register or sign in to comment