Avoid mutliple truncates for AOCO during vacuum.
Vacuum for AOCO happens in mutliple phases. Prepare phase always truncates the
file to logical EOF. So, there is no need for redundant calls in later phases.
@@ -481,17 +481,12 @@ AOCSDrop(Relation aorel,
/* Re-fetch under the write lock to get latest committed eof. */
fsinfo = GetAOCSFileSegInfo(aorel, SnapshotNow, segno);
- /* drop not planned, try at least eof truncation */
if (fsinfo->state == AOSEG_STATE_AWAITING_DROP)
{
Assert(HasLockForSegmentFileDrop(aorel));
AOCSCompaction_DropSegmentFile(aorel, segno);
ClearAOCSFileSegInfo(aorel, segno, AOSEG_STATE_DEFAULT);
}
- else
- {
- AOCSSegmentFileTruncateToEOF(aorel, fsinfo);
- }
pfree(fsinfo);
}
@@ -600,11 +595,6 @@ AOCSCompact(Relation aorel,
{
AOCSSegmentFileFullCompaction(aorel, insertDesc, fsinfo);
}
- else
- {
- /* compaction is skipped: Try eof truncation */
- AOCSSegmentFileTruncateToEOF(aorel, fsinfo);
- }
pfree(fsinfo);
}
