Confusing comment in tidbitmap.c

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Confusing comment in tidbitmap.c
Date: 2014-12-14 08:03:29
Message-ID: CAApHDvrYG5ooAMkxbiEs3fs_wkqk0ibfii=ghmtNJ9rTb_nVKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following comment above #define PAGES_PER_CHUNK in tibbitmap.c appears
to be incorrect:

"But we
* also want PAGES_PER_CHUNK to be a power of 2 to avoid expensive integer
* remainder operations. So, define it like this:"

I don't quite follow this as it does nothing of the kind.
Check tbm_page_is_lossy() where we do: bitno = pageno % PAGES_PER_CHUNK;

Or am I missing something about the compiler optimizing that to: bitno =
pageno & 255; ?

Regards

David Rowley

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2014-12-14 11:58:07 Re: speedup tidbitmap patch: cache page
Previous Message Amit Kapila 2014-12-14 06:24:13 Re: pg_basebackup vs. Windows and tablespaces