Pass heap tuple counts to parallel vacuum as double

From: Baji Shaik <baji(dot)pgdev(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Pass heap tuple counts to parallel vacuum as double
Date: 2026-11-09 23:15:48
Message-ID: CA+fm-ROT7pH2oBrp=hOJfh8ux+UO0Y0vRk7xD_wcdRVVqWrs+g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I noticed that parallel_vacuum_bulkdel_all_indexes() and
parallel_vacuum_cleanup_all_indexes() take the heap tuple count as long,
while lazy vacuum passes a double and vacuumparallel.c stores it as a
double in shared memory for the index AMs. Where long is 32 bits, as on
Windows, a table with more than about 2.1 billion tuples gets a wrong
num_heap_tuples only when its indexes are vacuumed in parallel. It's
rare in practice, but the serial path has no such limit.

The attached patch changes the parameter to double.

Thoughts?

Thanks,
Baji Shaik

Attachment Content-Type Size
0001-Pass-heap-tuple-counts-to-parallel-vacuum-as-double.patch application/octet-stream 2.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-11-09 23:59:50 Re: Add a hook for handling logical decoding messages on subscribers.
Previous Message surya poondla 2026-11-09 23:13:39 Re: Parallel vacuum: check XID wraparound failsafe between indexes