]> granicus.if.org Git - postgresql/commit
Tweak mdnblocks() to avoid doing lseek() on segments that it has
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 7 Jan 2003 01:19:12 +0000 (01:19 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 7 Jan 2003 01:19:12 +0000 (01:19 +0000)
commit973a210cce990134f63da12f8ca2d4d0718a103e
tree30db8be2100df01ae3a16a9657dae42f8e054aff
parentc9cf982038e11f9ce3b8fb5634cf49e6900f48b9
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.
src/backend/storage/smgr/md.c