Performance of JSONB vs. integer field storage in PostgreSQL I need to store some data with values like 0, 1 (true / false). I am considering grouping the different integer fields into one JSONB field with a structure like this:

{
  "status": 1,
  "approved": 0,
  "notified": 0
}


Is the speed of queries (with WHERE) the same when using JSONB vs. normal integer fields to filter the data?
Is the speed of queries (with WHERE) the same when using JSONB vs. normal integer fields to filter the data?


Of course not. The JSONB adds indirection. You have to resolve the key to the value.

That said, if you create an index on a boolean column, or a jsonb's boolean key it should be the same speed for an index lookup.