| From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
|---|---|
| To: | Divyansh Gupta JNsThMAudy <ag1567827(at)gmail(dot)com> |
| Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Need help in database design |
| Date: | 2024-12-23 17:07:12 |
| Message-ID: | e6d14a61-d1a0-4163-86a6-155e1dc6294f@aklaver.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
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(dot)klaver(at)aklaver(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Divyansh Gupta JNsThMAudy | 2024-12-23 17:07:20 | Re: Need help in database design |
| Previous Message | Ron Johnson | 2024-12-23 17:05:05 | Re: Need help in database design |