Fixed insert page logic for IVFFlat vacuuming - resolves #1078

Co-authored-by: Song Bian <29000790+Waterpine@users.noreply.github.com>
This commit is contained in:
Andrew KaneandSong Bian committed 2026-11-27 00:04:40 -08:00
1 parent 2d9b0b6b4f
commit 255bbf74b8
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -260,7 +260,7 @@ IvfflatUpdateList(Relation index, ListInfo listInfo,
{
/* Skip update if insert page is lower than original insert page */
/* This is needed to prevent insert from overwriting vacuum */
if (!BlockNumberIsValid(originalInsertPage) || insertPage >= originalInsertPage)
if (!BlockNumberIsValid(originalInsertPage) || list->insertPage >= originalInsertPage)
{
list->insertPage = insertPage;
changed = true;
+1 -1
View File
@@ -143,7 +143,7 @@ ivfflatbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
/* Set to first free page */
/* Must be set before searchPage is updated */
if (!BlockNumberIsValid(insertPage) && ndeletable > 0)
if (!BlockNumberIsValid(insertPage) && (ndeletable > 0 || maxoffno < FirstOffsetNumber || PageGetFreeSpace(page) >= ItemIdGetLength(PageGetItemId(page, FirstOffsetNumber))))
insertPage = searchPage;
searchPage = IvfflatPageGetOpaque(page)->nextblkno;