Re: [HACKERS] Proposal: Improve bitmap costing for lossy pages - Mailing list pgsql-hackers

From amul sul
Subject Re: [HACKERS] Proposal: Improve bitmap costing for lossy pages
Date
Msg-id CAAJ_b94+TAaBj4VeYGuEJUGdQSV1X4KfLhNR8pqrJJZ1Rc=aww@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Proposal: Improve bitmap costing for lossy pages  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: [HACKERS] Proposal: Improve bitmap costing for lossy pages
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] why not parallel seq scan for slow functions
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] proposal - Default namespaces for XPath expressions(PostgreSQL 11)