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 1sPekO-005fEH-QJ for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 08:56:52 +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 1sPekL-007slp-Rh for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 08:56:50 +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 1sPehA-007njL-OU for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 08:53:33 +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 1sPeh9-000Wld-8v for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 08:53:32 +0000 Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-e03a635cb51so315137276.2 for ; Fri, 05 Jul 2024 01:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720169609; x=1720774409; 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=cMPnw0G9/H6C5xHyTMS4tzjIrbUVPQTiZnqbPAs0JlE=; b=DnizzbDIJwV5APFs3FbUNIfAgWq27GubRQ8RcF9aIuXTDhUV5k95eHspCLXln16Jnb wicmZqnk6XqvMYW9K0V+s/WQjP2kdSdgN8gGlrPVzvxvJ6JbuIUyu72ulRE81FoJ3y3r 5RJKQXQE/eQeQbuRizQfmsoRvd7pROPIMCOWb4qqpl9VZcXrrcOItzq7ixC1KfnGeKsK 5Hh9wQpSPceohX0iureMk3DuyGFTil9vymDzDMImBfDBDExzJ4aD8q/UyHa7VzgGFG9t bDGBZK2ItFZFbWUISLZ3obuQs0aASZLpz3iDRXJOCuq4WuMvzRDYCt14r0+scHihZDeP 2lqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720169609; x=1720774409; 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=cMPnw0G9/H6C5xHyTMS4tzjIrbUVPQTiZnqbPAs0JlE=; b=A+5r+/OfHnW66y/31jXGnPRnOde980Y0OKHoQGcyRZDEUJeZHilGZFUjzxj7lOr9WR Dhwz4Q3oeBWKOEgEKr5z+QeNFhJ6rFQZxNzWK+obpJ1RSkVKJK3IX6XhrsMu6DbDRnO5 CL0XEMBE9VSSo92EC0P8Ifu4BkJd9oHQoDhNBkZAm8ktjAZlCdrZ0Ndn9H2lzAARqXFt /cv6G32ZdHfNb1EcM3ms2yqoe5dL3rgqy0wBhxsmobefWrUkZQP93O5X/uf2KVQlcOMY KxHuUy1Zahh2SLVz1Wb0JgPd3CXIuROc/vqW+aPNf2msK7zQ89IgJNB2xSvqqrAwXMwR LwMg== X-Forwarded-Encrypted: i=1; AJvYcCUl2dQVrgd2jYxHpglnPIsF+jSeuexo299NaBC9BTYVE7BYa7d5tgXCGX2UlD8EtQtd5kICR88Y8aGTJNzhzk6jQTVZgZXfRIwmL4zzRAPv2vI5 X-Gm-Message-State: AOJu0YwPFqheTM3/0+Ajzu7/3S2DNozpiyqfMeA3zaAaeauK3odcNZnA p/UnhbVy6ynagcabcfhOZTaa7X6QfTRgEnDpRbTcjEYztagdPiUw+q4amVSxY4kCw9DZ7jpnyZH flxelQbOoU+2t/whKveymxgISOR8= X-Google-Smtp-Source: AGHT+IGoLhN9CuQQWb/AkuLvBX6RDEnCvegjwvIdKMJr8fh7yfUHJjmhr3uWB6n4tkesPmaRwv71FmwHSSY3me1Rdv0= X-Received: by 2002:a81:8448:0:b0:64a:4306:1045 with SMTP id 00721157ae682-652d5225662mr30190227b3.1.1720169609422; Fri, 05 Jul 2024 01:53:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lok P Date: Fri, 5 Jul 2024 14:23:17 +0530 Message-ID: Subject: Re: Design strategy for table with many attributes To: David Rowley Cc: Guyren Howe , pgsql-general Content-Type: multipart/alternative; boundary="00000000000085f39f061c7c322b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000085f39f061c7c322b Content-Type: text/plain; charset="UTF-8" On Fri, 5 Jul, 2024, 1:44 pm David Rowley, wrote: > On Fri, 5 Jul 2024 at 19:53, Lok P wrote: > > As David suggested it breaks if a row exceeds the 8k limit I. E a single > page size , will that still holds true if we have a column with JSON in it? > > You wouldn't be at risk of the same tuple length problem if you > reduced the column count and stored the additional details in JSON. > Each varlena column is either stored in the tuple inline, or toasted > and stored out of line. Out of line values need an 18-byte pointer to > the toasted data. That pointer contributes to the tuple length. > > > David > Got it. Thank you very much. So there would be performance overhead with JSON and we need to validate that carefully, if at all going in that direction. However out of curiosity, if the roasted/compressed component or column which is JSON itself goes beyond 8k post compression, will it break then? --00000000000085f39f061c7c322b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Fri, 5 Jul, 2024, 1:44 pm David= Rowley, <dgrowleyml@gmail.com> wrote:
On Fri, 5 Jul 2024 at= 19:53, Lok P <loknath.73@gmail.com> wrote:
> As David suggested it breaks if a row exceeds the 8k limit I. E a sing= le page size , will that still holds true if we have a column with JSON in = it?

You wouldn't be at risk of the same tuple length problem if you
reduced the column count and stored the additional details in JSON.
Each varlena column is either stored in the tuple inline, or toasted
and stored out of line. Out of line values need an 18-byte pointer to
the toasted data. That pointer contributes to the tuple length.


David

Got it. Thank you very much.=C2=A0

So there would be performance overhead wi= th JSON and we need to validate that carefully, if at all going in that dir= ection.=C2=A0

However ou= t of curiosity, if the roasted/compressed component or column which is JSON= itself goes beyond 8k post compression, will it break then?=C2=A0

--00000000000085f39f061c7c322b--