3 ms·
Array foreign keys and indexes on arrays/JSON nested fields. When using MongoDB, having this eliminates most need for join tables. (*This may have already been
by dudeinjapan 4y ago
Array foreign keys and indexes on arrays/JSON nested fields. When using MongoDB, having this eliminates most need for join tables. (*This may have already been implemented, I haven't used SQL recently.)
- aidos 4y agoI think they have indexes on json (or any selectable thing?). You could probably implement the foreign key using generated columns these days. Ah I guess you mean instead of having the association table? That would definitely be nice in some cases.
- stephen 4y ago> Array foreign keys Yes! We very occasionally use integer[] columns with ids, but hold off on using them widely b/c of the lack of integrity constraints. It'd be awesome to use more often.
- nhumrich 4y agoYes! Array of foreign keys would be amazing!
- jeltz 4y agoPostgreSQL has had indexes on JSON for many years.