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?
boolean
for boolean values, in a properly normalized way. Also, you can try this easily for yourself, just set up the same data in both ways.