On 12/23/24 09:01, Divyansh Gupta JNsThMAudy wrote:
> Sure , for example, I have 50 key with name as t1 , t2 ,t3 .......t50
>
> Now each key could have values from 0 to 3
>
> So let suppose we have JSONB like that for row r1
>
> {
>
> t1: 1
>
> t2: 2
>
> t3 : 3
>
> }
>
>
> As if I convert it into columns so r1 will have
>
> t1 column will contain 1
>
> t2 column will contain 2
>
> ...... So on
>
>
> So here my question is considering one JSONB column is perfect or
> considering 50 columns will be more optimised.
>
1) How are you going to use the key:value pairs in queries?
2) I would recommend creating a sample dataset that you import into
tables that are built with either the column method or the JSON method
and test a representative set of queries.
--
Adrian Klaver
adrian.klaver@aklaver.com