Hi Dilip,
v6 patch:42 + /*43 + * Estimate number of hashtable entries we can have within
maxbytes. This44 + * estimates the hash cost as sizeof(PagetableEntry).45 + */46 + nbuckets = maxbytes /47 +
(sizeof(PagetableEntry) + sizeof(Pointer) + sizeof(Pointer));
It took me a little while to understand this calculation. You have moved this
code from tbm_create(), but I think you should move the following
comment as well:
tidbitmap.c:276 /*277 * Estimate number of hashtable entries we can have within
maxbytes. This278 * estimates the hash cost as sizeof(PagetableEntry), which
is good enough279 * for our purpose. Also count an extra Pointer per entry
for the arrays280 * created during iteration readout.281 */
Regards,
Amul
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers