Answer the question
In order to leave comments, you need to log in
JSONB search in Postgresql?
The administrator creates fields by directly specifying their type string, int, etc. (this is a separate Fields table), but the user must fill in the same fields with data, so the UserData table is needed, in which data can be presented in two versions:
id:int | value:string | field_id:int
id:int | data:jsonb
Answer the question
In order to leave comments, you need to log in
If you understand your task correctly, selecting from one table on a JSONB field indexed by GIN using the @> operator will be much faster than selecting from several related tables (EAV model).
Proof
Read
more here in the comments to the answers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question