Re: Need help in database design - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Need help in database design
Date
Msg-id e6d14a61-d1a0-4163-86a6-155e1dc6294f@aklaver.com
Whole thread Raw
In response to Re: Need help in database design  (Divyansh Gupta JNsThMAudy <ag1567827@gmail.com>)
List 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.klaver@aklaver.com




pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Need help in database design
Next
From: Divyansh Gupta JNsThMAudy
Date:
Subject: Re: Need help in database design