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 1sPcQz-005UEi-05 for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 06:28:41 +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 1sPcQx-006tfq-0z for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 06:28:39 +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 1sPcQw-006tfh-MZ for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 06:28:39 +0000 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sPcQv-000Vh8-Om for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 06:28:38 +0000 Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-df771cae64bso298920276.3 for ; Thu, 04 Jul 2024 23:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720160915; x=1720765715; 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=Lm4mtvkg6bHCt9qxMAYuI7k+IhoFuDCYa+RYGcfBrQ4=; b=lz/jEdck9+6GpVR5wgn7X5UkiZQG0h3r4vcULBzPTTEYmxTCeHqShbX2H8vsUINm8o sH9CC0D0NXh50IpTgClFiJyNP2TGWGUNYns6NK3DopyYGvVMtm2Jcgv3QpEGqo4B+HUb 7sMu11PNtV69Q3iiUV36mMGdOWBJJenfys2M61ezFUku69qtjWdhA8UaonTQeawQQTQB JNoaGvnkb9eMUI9mhY+fdySqusc7Mzz8ULzZ/Pqnm+sIDYGZx2V/OGxBWx0VeRCf6+K4 vMD6oMaadwxmkUgOgWzK/LwnXiZE5acs0bHC9OBVtfolxRWjc2wNdD15UYflXNXIz6KS 76zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720160915; x=1720765715; 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=Lm4mtvkg6bHCt9qxMAYuI7k+IhoFuDCYa+RYGcfBrQ4=; b=j5VaFpwiGMcEZAJR1Lmv//IRk8Belg82owWHZod4FXbPdWTh+hWOtwrlTcNk7/tQv3 9Csq1iNbABITZgJppcl3uWfvOxPAVhZOMLXXOKsPzu9XioUIikDxuT4Ymb+Zn2eSmpyl tejnSaarN8AxysXr4QajIRS7edXzLEfnWbu6o/VAwxPHKjtRXpB+Y1WzsbmdP1aCGAoi zeqLUFgeCg99OSLXJGhChDifL/XLyas8bDJaWz9MF8A9qRcy4yksSn91XBc9zi044IyF SXAXt9BJVK8EJBaYFbV/6em01UCdmooos881zVZbd5hPLTp4y6opwwNxahtpkBqWwD99 7W4Q== X-Gm-Message-State: AOJu0YzzA7pmFcAH4+sFojzEz3ivQ3YTR6yEu570ULP/EP4LTGWXs1Vo 58F3mo4Y6ZfhzVs8WdnEG3E+ew7l9f745MEQIU/FRP3XqsvqC9oqHDvTcWPIP8OmDrSmJfmY1CA Fp0ftFSaENDLj8yDH8Kpn/UyUv8E= X-Google-Smtp-Source: AGHT+IH4tPbWOp98ggER24KpaViRHJ/4YrfL8eFRB1OGufVjAN3Jc4rvTECxhQcWgWAdr9O/+lRnZx//SAdsdH89MHI= X-Received: by 2002:a5b:646:0:b0:e03:4f86:89c7 with SMTP id 3f1490d57ef6-e03c1be967fmr2658718276.6.1720160915287; Thu, 04 Jul 2024 23:28:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lok P Date: Fri, 5 Jul 2024 11:58:23 +0530 Message-ID: Subject: Re: Design strategy for table with many attributes To: Guyren Howe Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000004ff6d7061c7a2c8e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004ff6d7061c7a2c8e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jul 5, 2024 at 10:45=E2=80=AFAM Guyren Howe wrot= e: > On Jul 4, 2024, at 22:07, Lok P wrote: > > If you stick to the principle of grouping columns in a table when you use > those columns together, you should be good. > > Note that you might want to split up the =E2=80=9Cparent=E2=80=9D table i= f that naturally > groups its columns together for certain uses. In that case, you could hav= e > the same pk on all the 1:1 tables you then have. In that case, the pk for > each of those tables is also the fk. > Thank you. When you said below, *"Note that you might want to split up the =E2=80=9Cparent=E2=80=9D table i= f that naturally groups its columns together for certain uses. In that case, you could have the same pk on all the 1:1 tables you then have. In that case, the pk for each of those tables is also the fk."* Do you mean having a real FK created through DDL and maintaining it or just assume it and no need to define it for all the pieces/tables. Only keep the same PK across all the pieces and as we know these are related to the same transaction and are logically related? --0000000000004ff6d7061c7a2c8e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Fri, Jul 5, 2024 at 10:45=E2=80=AFAM G= uyren Howe <guyren@gmail.com>= wrote:
On = Jul 4, 2024, at 22:07, Lok P <loknath.73@gmail.com> wrote:

= If you stick to the principle of grouping columns in a table when you use t= hose columns together, you should be good.

Note th= at you might want to split up the =E2=80=9Cparent=E2=80=9D table if that na= turally groups its columns together for certain uses. In that case, you cou= ld have the same pk on all the 1:1 tables you then have. In that case, the = pk for each of those tables is also the fk.

Thank you.

When you said below,
"N= ote that you might want to split up the =E2=80=9Cparent=E2=80=9D table if t= hat naturally groups its columns together for certain uses. In that case, y= ou could have the same pk on all the 1:1 tables you then have. In that case= , the pk for each of those tables is also the fk."

Do = you mean having a real FK created through DDL and maintaining it or just as= sume it and no need to define it for all the pieces/tables. Only keep the s= ame PK across all the pieces and as we know these are related to the same t= ransaction and are logically related?=C2=A0
--0000000000004ff6d7061c7a2c8e--