If there are 20 bit columns (non-null boolean), is it better to explicitly hold them in an integer type (int32)? Or, will the underlying database merge them in a single integer?I'm using PostgreSQL, though. Generally, is using bit-mask in SQL databases kind of anti-pattern?Backgrounds: The usage of these bit columns are left to be defined by the end user, along with a few of other int, float, double, varchar columns, so as to make the table a little more extensible. I'm also not going to use one-to-many custom property table in practice. Add an integer column is cheap, but if the underlying database could store several bit columns in one int32 field, I don't have to explicit merge them myself.
How about multiple bits performance in common databases?
sql;bitwise operators