4 ms·
They’re great for denormalisation, which is often an appropriate trade off.
by lucian1900 6y ago
They’re great for denormalisation, which is often an appropriate trade off.
- bitexploder 6y agoEven storing JSON blobs isn’t the hit it used to be. It’s not relational, but you can index on fields in the JSON and query it effectively. The Postgres array and other types are great for stuff at the edges of your database or when you know you won’t need to build relations into or on that data. RDBMS like Postgres really provide a powerful, powerful technology for managing data.
- colanderman 6y agoYes! Have one-to-many data that you know you will usually always grab all in one go, and won't ever participate in a relation? Arrays are the way to go. JSONB can be similarly highly appropriate. They can greatly reduce the number of disk reads needed for certain workloads. Don't forget that both can be indexed in Postgres! And the indexes are more powerful than what you can do with the equivalent relational layout, as they support efficient subset queries.
- sk5t 6y agoSame goes for hstore and the @> style operators.