Comment
Comment by craftkiller
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