diff --git a/tsl/src/chunk.c b/tsl/src/chunk.c index 6ad0a406832..9bb68957735 100644 --- a/tsl/src/chunk.c +++ b/tsl/src/chunk.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -661,8 +662,10 @@ static TableAmRoutine routine = {}; static uint64 pq17_workaround_merge_relation_size(Relation rel, ForkNumber forkNumber) { + uint64 nblocks = merge_rel_nblocks; + if (forkNumber == MAIN_FORKNUM) - return merge_rel_nblocks * BLCKSZ; + return nblocks * BLCKSZ; return old_routine->relation_size(rel, forkNumber); }