Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tPlOy-00F6pH-Lx for pgsql-general@arkaria.postgresql.org; Mon, 23 Dec 2024 16:35:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tPlOy-00CLFW-21 for pgsql-general@arkaria.postgresql.org; Mon, 23 Dec 2024 16:35:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tPlOw-00CLFI-Qj for pgsql-general@lists.postgresql.org; Mon, 23 Dec 2024 16:35:27 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tPlOs-001FHG-Ue for pgsql-general@lists.postgresql.org; Mon, 23 Dec 2024 16:35:25 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 9B22F25401AB; Mon, 23 Dec 2024 11:35:20 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Mon, 23 Dec 2024 11:35:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1734971720; x=1735058120; bh=B6y1znhb6+aL/+QnGKCYt9Vi9QP6S8gEBbY/WhRxpGg=; b= kZZ2PUw+6TfxYBON9wGrZsl/tGeHRIQtnyGcBsfF8/Zccekux+OGJclDgrnUuQ24 Zn7sXDou/anW526m6L0q6Xl4aJlWKRQGZv4xU1luA0h2tSiWh+iAjssY9kl3vhnb PUiSv2nlPfOEyyICvwWNQ0A6PzAHfLDISqjLfknIwprHB38Fr3D+eBkXYSWZh2a/ WrSKsOlnVI6W1TxP4zcEo9HfQjdBdO/SiNrsGzxMTzWG2P7SU9E+/1VS5XeqE9Mn SUw8q9cG7O6TMtOQvwRg53VletrQL1mXSTsbQwVr0N+Y/rlY3B/v6uIJFbvEjvGO hhITRqd9wCmzt2zCcFzOdQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1734971720; x=1735058120; bh=B 6y1znhb6+aL/+QnGKCYt9Vi9QP6S8gEBbY/WhRxpGg=; b=eA0V6FzxSmLRGZQnD W39diEs9blXYPYoKb5eRErCFSkSqFLKL7BaxJZmLKTawFb7fkk4Ty+eTGFaKnXC8 l/h1qrp4KXPZ5aFXGH0mNw4ous5x7cTEVZcfV48MyTQXn4Ukeygrm5bpInEdZA8+ qXluA2LPpQ5ZoieRTTPSlZEecik8DpLPkzmU/enjO5/6XvWm1A5C6bx3gwO4ESf4 1iamSU+E0mthSIfwNANM8pcbybnQkoimCY8C6mwvGi89evfwloUxdUpWFNKPK8U2 dOu+9Q0Ar3Zk6pcjqK3zjeKoAgB5wvHjPLTbfL7up02QNtp1sP6weI+h/g5ksm5L FK9rw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudduvddgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghr uceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrth htvghrnhepiedvhfeiheehgeeuieeljeeitedtjeehudegfeelkedvleekhedtgfeiffef kedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg gurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohep vddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghgudehieejkedvjeesghhmrg hilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhp ohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Dec 2024 11:35:19 -0500 (EST) Message-ID: Date: Mon, 23 Dec 2024 08:35:18 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Need help in database design To: Divyansh Gupta JNsThMAudy , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/23/24 07:53, Divyansh Gupta JNsThMAudy wrote: > Hii Community, > > I need to provide a support for some functionality for my application > for that I need to store 50 key value pair set, so I am in a dilemma, > weather I create 50 new columns of int2 data type each column will This is unclear, I am trying to figure out you go from '50 key value pair set' to '50 new columns of int2'. In other words how 50 pairs turn into 50 columns? Then there is the question of why 50 keys per row in the first place? > contain value of a specific key or should I go with JSONB data type with > 50 key value pair, the table on which I am going to do that all contains > 1 Billion rows of data and have 84 hash partitions, I have gone through > multiple articles some of them mentioned it's a good approach to create > 50 new columns and some states that creating one JSONB would be best > that's why I need your help to move forward, also I am ready to make > H-Store instead of JSONB if it provides better performance. > Please help me to comes out from that dilemma. > > Regards, > Divyansh Gupta, > Database Administrator -- Adrian Klaver adrian.klaver@aklaver.com