| ▲ | craftkiller 5 days ago | |||||||||||||
If you're using postgres, couldn't you just create an index on the field inside the JSONB column directly? What advantage are you getting from extracting it to a separate column?
ref: https://www.crunchydata.com/blog/indexing-jsonb-in-postgres | ||||||||||||||
| ▲ | jelder 5 days ago | parent | next [-] | |||||||||||||
That works for lookups but not for foreign key constraints. | ||||||||||||||
| ||||||||||||||
| ▲ | morshu9001 5 days ago | parent | prev [-] | |||||||||||||
You only need gin if you want to index the entire jsonb. For a specific attribute, you can use the default (btree) which I'm guessing is faster. | ||||||||||||||
| ||||||||||||||