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 1sPbAU-005MGP-BX for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 05:07:34 +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 1sPbAS-0069ya-0F for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 05:07:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPbAR-0069yS-LR for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 05:07:32 +0000 Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sPbAP-000TiO-Qp for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 05:07:31 +0000 Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-e0248b1c29bso227812276.1 for ; Thu, 04 Jul 2024 22:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720156049; x=1720760849; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=po0rzjq1uNiSlOUX54tA1BD/n3azadQJk0Lz72ia5aQ=; b=VHFbekOZfso8OxeD6T3ByccKpncAaskFCIQKTvMb/FmOAzoG/BLMWtBLobBfYP5nL8 Xi7iK7+zTPDY8lJJMmkLrfmzRsVa8+/WpKwuGwbuIdbYnOSOqGC84q1lAJz3ZdrSybn8 bBSn/RHoQNjFTNWLfyIV9HicJUzT1DVinsI9ehNuBojN/oDoCSAS2L1Z+0eKULghEwoF O71i8CoF93kB1aomXlmgUab4qXqq5FH4mVqLHxMulEurUTJ3P9mKjnlBrN+nn4VQUQ5m hVQopKSvdVkr56UWB8tIaFZS3YToSMDQbFkMnTNbZuIMGa8Ea4963tXHuPYO9+D0CKvv +2sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720156049; x=1720760849; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=po0rzjq1uNiSlOUX54tA1BD/n3azadQJk0Lz72ia5aQ=; b=YzzMCFgDrQLqinQQa/hqGegWk6C90rEbFXslam2NWt3ZwAtV7QxcUlvaSE9kBEKhgJ PyH0bKea6PIJeU9Z3NCmCm8QyTBdT2tpxuIzAa/rOSCYTvr0j+hCJa1174kXqApiH7Dm RFM7/tl0wp1h7cdngf7SUNaCcNBCAMfYoAjh+uuOl1wDwTjy/pvPD0tAZ2aMDinzC/rF GhzRedn2GfQDMxdABX9h2Xl0E+xQhlrq5y1ecl4i6y0Jx5QMwFoycZFQ9Dgzy9eKGpUF Ejikf+XBkqvNUtXtv/fg4T58B4VeeECJEgg+TGCMQ0SsB2Df/b4l81X1ZLZHOAUOX/Ez sUrw== X-Gm-Message-State: AOJu0YzdLQXImHBBoBtaSOxRRNFBq2l5ROCc/oO+U25/oA6I4J3AFwP6 ryx0m+Y8UohhJXBqs3RL/6KLL4WKfXZoUqYtmbE8GPrRFwCdjq685tait2gO7cNWVrW/GSuimlJ xglxyg57rx3OPsOEucm70NdbGQehQJg== X-Google-Smtp-Source: AGHT+IE4UhzrVDuqTvtBsZxUL++jjrp77srXAPBIn+cOvjHZ6iRLhxTkBsn9rUHTT6RMPkAFOoL37QKCQ8paSBcdzuc= X-Received: by 2002:a81:c248:0:b0:64b:95ef:d098 with SMTP id 00721157ae682-652d28ff10cmr27999317b3.0.1720156048863; Thu, 04 Jul 2024 22:07:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lok P Date: Fri, 5 Jul 2024 10:37:16 +0530 Message-ID: Subject: Re: Design strategy for table with many attributes To: "David G. Johnston" Cc: pgsql-general Content-Type: multipart/alternative; boundary="00000000000040414d061c790a4c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000040414d061c790a4c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jul 5, 2024 at 1:26=E2=80=AFAM David G. Johnston wrote: > On Thu, Jul 4, 2024 at 12:38=E2=80=AFPM Lok P wrot= e: > >> >> Should we break the single transaction into multiple tables like one mai= n >> table and other addenda tables with the same primary key to join and fet= ch >> the results wherever necessary? >> >> > I would say yes. Find a way to logically group sets of columns together > and place those groups into separate tables. I'd also be looking for cas= es > where multiple columns really should be multiple rows. This is not > uncommon. > > David J. > > Thank you David. As you said, to logically break this into multiple tables so i believe it means it should be such that there will be no need to query multiple tables and join them most of the time for fetching the results. It should just fetch the results from one table at any point in time. But do you also suggest keeping those table pieces related to each other through the same primary key ? Won't there be a problem when we load the data like say for example , in normal scenario the data load will be to one table but when we break it to multiple tables it will happen to all the individual pieces, won't that cause additional burden to the data load? Also I understand the technical limitation of the max number of columns per table is ~1600. But should you advise to restrict/stop us to some low number long before reaching that limit , such that we will not face any anomalies when we grow in future. And if we should maintain any specific order in the columns from start to end column in the specific table? --00000000000040414d061c790a4c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Jul 5, 2024 at 1:26=E2=80=AFAM Da= vid G. Johnston <david.g.j= ohnston@gmail.com> wrote:
On Thu, Jul 4, 2024 at 12:38=E2=80=AFP= M Lok P <lokna= th.73@gmail.com> wrote:
Should we break the single transaction into multiple tables lik= e one main table and other addenda tables with the same primary key to join= and fetch the results wherever necessary?


I= would say yes.=C2=A0 Find a way to logically group sets of columns togethe= r and place those groups into separate tables.=C2=A0 I'd also be lookin= g for cases where multiple columns really should be multiple rows.=C2=A0 Th= is is not uncommon.

David J= .


Thank you David.

As you said, to logically break this into multiple tables so i beli= eve it means it should be such that there will be no need to query multiple= =C2=A0tables and join them most of the time for fetching the results. It sh= ould just fetch the results from one table at any point in time.=C2=A0=C2= =A0

But do you also suggest keeping those table pi= eces related to each other through the same primary key ? Won't there b= e a problem when we load the data like say for example , in normal scenario= =C2=A0the data load will be to one table but when we break it to multiple t= ables it will happen to all the individual pieces, won't that cause add= itional burden to the data load?

Also I understand= the technical limitation of the max number of columns=C2=A0per table is ~1= 600. But should you advise to restrict/stop us to some low number long befo= re reaching that limit , such that we will not face any anomalies when we g= row in future. And if we should maintain any specific order in the columns = from start to end column in the specific table?
--00000000000040414d061c790a4c--