Microoptimization of Bitmapset usage in postgres_fdw

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Postgres hackers <pgsql-hackers@postgresql.org>
Date: 2018-05-29T15:40:18Z
Lists: pgsql-hackers

Attachments

There are a couple of places in postgres_fdw where we check if the Bitmapset
has multiple members using bms_num_members(), without storing the returned
count.  The attached patch instead use bms_membership() which is optimized for
just that usecase, and (IMO) makes for clearer code.

cheers ./daniel

Commits

  1. Use optimized bitmap set function for membership test in postgres_fdw