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 1sPe57-005bj4-Lw for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 08:14:13 +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 1sPe54-007Uuc-CL for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 08:14:11 +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 1sPe54-007UuT-1d for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 08:14:10 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sPe52-000V6J-A9 for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 08:14:09 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-52ccc40e72eso898176e87.3 for ; Fri, 05 Jul 2024 01:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720167246; x=1720772046; 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=+2kxbi2iYGNn3/C4WCe2iMJDAoJc72Npgx9iJhGwDQw=; b=hUSTUx8uAOBP4iRJoADs+mjgEr0qaVMYENJjYDhD5niaTK18ZEvM1BpgJFAbw9gizP ymznrnD4AEP8Ld1OvX6zA6CNSnCN7DAOcMgDqJXk61IlCm5Sd89rHb3KFlqqnTR1TD1z dNPZQkxxCVHlPIQejEbVSTBn9IQRN/rqTPcoF/l/fa502iRm3AXotzFrIGWFVCheFXuF bWynFnxlWPXdhPbEf8jqrK9GQzFHQeJOieKNNxSE2jAVzeO31qVObY/Yj0rxgoXIOBMB UQsWe1QIGZulNey8v9MWQv3JOr3nQaiveH+QDsb93KrLdr1PW68NYmfnn00wHGoQ1jM0 Qy8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720167246; x=1720772046; 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=+2kxbi2iYGNn3/C4WCe2iMJDAoJc72Npgx9iJhGwDQw=; b=qcdT7qJX8wi1h9Sxq7OSTInAECeUd5G4uEptMmLkfYY+ukbz7YhZBHsR1mP/66FZE9 4td8DLucUFWfv/D3iYBdsrV5EfTDgQlaJt9qufmsdNM2Pudxrq6lMTIJT75TJu6Z8O+z sJcJ6fke+WVRKArIPp01Gk3qafdoNPUukp4ne0JTvz7reoF9g1aCqTverGn/JU74WLSi 4RWLMXRLLbZQazsryvLynIyvGGwDZv5xI1rs41Peps8W5CcxBInsEudbk/bPPjN54Ao6 YwZH1Z2P4vDGhcu+m/58OCfH+QEb71A0uZfGI3x8z/B1X6r/VYMtKBOCBfrCpxfax4X6 9VSA== X-Forwarded-Encrypted: i=1; AJvYcCXIkeVVOT1kWv5W+V4gwBJifq8ZzTvLl7dIDDuFlqnnG1Z8ds4/nLX5w+a3WX9uZEoE3gzOdc1K5dYbT1qGuDqhOUV7OvKM7dp0X+4XASvSFvVi X-Gm-Message-State: AOJu0Yz8n4HU++X1PT4ntPHnkN7LsQMt2N0ejMqOFJXKTZWImr0TzMhN cWEY73YkgHrr+eGyuVGAdlSqtuXUvsIRY0jkZqi74IEn0T1pcevEtJ+0tqSPPKZ5mXBmMV+QOkk 8IFWIFTLenHswffVZdM6dCiarFJY= X-Google-Smtp-Source: AGHT+IEtK/HrypSnINX5xOzilukCxAYCuCfmke041aqBp037i7oWs3yPaeGk6cGpiyWNpxzFNWKpYov1sbaNczaJh7A= X-Received: by 2002:a05:6512:6c6:b0:52e:a721:497b with SMTP id 2adb3069b0e04-52ea7214b09mr807060e87.38.1720167246214; Fri, 05 Jul 2024 01:14:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Fri, 5 Jul 2024 20:13:54 +1200 Message-ID: Subject: Re: Design strategy for table with many attributes To: Lok P Cc: Guyren Howe , pgsql-general Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. This isn't me advocating for JSON. I'm just explaining the limitations. I think I'd only advocate for JSON if the properties you need to store vary wildly between each tuple. There's a large overhead to storing JSON labels, which you'd pay the price of for each tuple. That sounds like it would scale terribly with the data volumes you've suggested you'll be processing. David