Hi,

 

ISTM the code in tidbitmap.c should be improved.  Patch attached.  I think
this patch increases the efficiency a bit.

 

Thanks,

 

Best regards,

Etsuro Fujita

diff --git a/src/backend/nodes/tidbitmap.c b/src/backend/nodes/tidbitmap.c
index 3ef0112..43628ac 100644
--- a/src/backend/nodes/tidbitmap.c
+++ b/src/backend/nodes/tidbitmap.c
@@ -361,7 +361,7 @@ tbm_union_page(TIDBitmap *a, const PagetableEntry *bpage)
        if (bpage->ischunk)
        {
                /* Scan b's chunk, mark each indicated page lossy in a */
-               for (wordnum = 0; wordnum < WORDS_PER_PAGE; wordnum++)
+               for (wordnum = 0; wordnum < WORDS_PER_CHUNK; wordnum++)
                {
                        bitmapword      w = bpage->words[wordnum];

@@ -473,7 +473,7 @@ tbm_intersect_page(TIDBitmap *a, PagetableEntry *apage, 
const TIDBitmap *b)
                /* Scan each bit in chunk, try to clear */
                bool            candelete = true;

-               for (wordnum = 0; wordnum < WORDS_PER_PAGE; wordnum++)
+               for (wordnum = 0; wordnum < WORDS_PER_CHUNK; wordnum++)
                {
                        bitmapword      w = apage->words[wordnum];
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to