In Postgres, NULL values take one bit of storage as far as I understand. So a table has to be very, very wide before this becomes a benefit. Of course if you have attributes that you don't control but are e.g. user-specified, JSONB column are a good choice.
Re:Django 3.1
by woadwarrior01 on Tuesday August 04, 2020 @12:40PM
(#24051722)
The traditional approach to efficiently modelling data like that with relational databases is to use the EAV[1] model, which works quite well in practice.
[1]: https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80...
For example, if there are 1000 possible attributes, only 5% are populated for any given row. If you have 1000 columns you are going to have a ridiculously wide and mostly empty table.