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.96) (envelope-from ) id 1vqPxQ-00AR3c-29 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Feb 2026 06:13:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vqPxO-0076oA-2Z for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Feb 2026 06:13:43 +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.96) (envelope-from ) id 1vqPxO-0076o1-1H for pgsql-hackers@lists.postgresql.org; Thu, 12 Feb 2026 06:13:43 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vqPxM-00000000GnE-3kH6 for pgsql-hackers@lists.postgresql.org; Thu, 12 Feb 2026 06:13:42 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-59dd54b1073so6024895e87.0 for ; Wed, 11 Feb 2026 22:13:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770876820; cv=none; d=google.com; s=arc-20240605; b=M2pCAMnqxd48x2VAQIZu09GerLasNbDmSYPKlMBaSR2bDBfPA2B6oXOJ+7fxNpD1q9 KRY/a990d3gzIxa61EARf8A/U8bvgS6mh2mBhxINUJqwzzioL2QJNm3IPTLdvuykLvFl 8KZOXroPYkjoAp5/kpv1YSHHcq9ELWzW7EfGJvqH3epxz9W7skbA/n/AAsg0aalV1dSQ oURX/Ebn5Gc1w0OyWMfYyDxxm9dwhz5oOsEteto/OQ3EkNIle1F5HCeZiRk/D4aXNaUu GEX3THC5t1GI6xjMRVYO21IuJbBUgZQ385Llm4HerLk1DpeJw5UXgI+KXb1Hv9sRGQ/w jvBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=s7eVPN8tVBOKgQB+0GSo2Giv+r3L33qwzxpeOBSE5Yw=; fh=v8+Xd25oyUQMBE/3gx1ivmCG8mLCBxu4c7yjg40cjR0=; b=MUgTjQQYKNJd4UzyxqHJrIQu0LILg0YWnmSypt0T5KZZ1CbghzYeNqZqaaQO1N9SAQ fj6nFSWGnSdoTv/AelWXWgQ4SOD6i6XO6w7X1he2A3u08Z4P88l55Y4hqxbVu2ZxF3L7 p4njyPwe67dFLy3onmXF26Z5gjb7uQvZzwC9xy7ke/Zwg9GRh/aH7q1iAOUZQkwh7iN4 u/Y0RiHINvOcCeldVkXjfUKDXwR/+/fkfXx6D8LrezhrD0uR2j1Z7XTnzoEqwYr4Phw7 YQrWl7Ym/ZT/DSSOTaw+GfTN09Ewwh7gAmNY+cibBV7zp9CjA5ODAFPoO6N6MAx2Sk3M zJqw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770876820; x=1771481620; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=s7eVPN8tVBOKgQB+0GSo2Giv+r3L33qwzxpeOBSE5Yw=; b=L7Gn5xzT32pnY0hhbVeeN3cWGHAnHC8FCwiCOwkGgMSBPpKYoJ+D1Sujvw/Ga8RwgS bjPpRuSg2NhrJMky3rGR/KYb7S2cgtU98qkpSs2hFnsT88i1+sqhi+oAFhhc4sOdxpM3 C1XWy9KQuLE6u/7uD6XJGzbjTytyg/xfHm+9Y+m25MnMEVi7QJLNprdglpUehynIgkNd TXmwA5zBrUY8KIbLegSquhTQ/5g+XsUGr1F6ELb1S7oGbReNlWASV6Sme5R+eQXm03mf /SpReubtuod7Wkokl4XiE7POo48swsCfpF0GEujaPklEA9QMizKgIBKPSXA0hqokHyEc C0sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770876820; x=1771481620; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=s7eVPN8tVBOKgQB+0GSo2Giv+r3L33qwzxpeOBSE5Yw=; b=M47wkijpGzx32qMKyZvQt9caP8+CMc+qVT1QIn2ViZI6GV7yd6JeUXtTTmMON6MYoj W3ndlGz0cI3HOxA713nvgJClgunfXexWII1Qd8rhvJRPNkTw13vJMtPoqcE9bOM/lCRU dp5NIXx4BlUj14P6mjhz6JDQbAeZBVvotaFPG+ud/2/UxDmmWIbCR4jNMd/lBNavBo0Q thfRvlQuRw//Sf7Wm2Ke8OIefsVhNz0i+9fYra2QHeTDNsHwiczjqpyZjfSqy6Zb+FJ8 I+nW79gA/Zz6d0a3rOOTKr+w/NNP8bzeJP7bMo783jEmJIbXVpPIl6EW11XqlIZIaViK xUQQ== X-Forwarded-Encrypted: i=1; AJvYcCXi0SQa4a3OBB3OHnbpBdxAoqYmpagMppJNQYKRZ9/klOzL8KcexynPZnQCKxjIjS+lHrg/zlbbpxqLiiir@lists.postgresql.org X-Gm-Message-State: AOJu0YxMhDpQg696IUC0QX8G4bGiEOiae98k+vqJuIkGP/tyOeTkPPDy hAbX/bEGUS0QTS9Az11VfuX3VOaaT1TiDc0bW+YAVIBpW0/mNkKnfWPkk7tqoxDcsQNy8b0ZGsi olkQJFGqZ1SM2rcn49mu6GlzWi1LM18c= X-Gm-Gg: AZuq6aKpgPuCWqvCGiPGjVLuQm3k6dLKlS8pgarWG0TQT/LBCkuJ/QeE5zIfb4ziAj2 keA9EHxTr+YHB6PYXncoSAA6aNt2EGN8cmM8ssYc36OR20x0S0hwX46z8ucTx9a8L3VAuJBGr7h WHSVgW7JNmJK5ZUDwtqEXp2uaFmfUQrT6qIjIMeIrt/XpW4W/SCSiczuUqjr42TUVNUNbbb2Taw rv1Rp4CMBn3eOr1CMeak6DfjrsrA3Phr/ISWMlRf+zKajhMEHG41dp7CuK9EI7yr6wIYE05plGx 3y/f/n0= X-Received: by 2002:a05:6512:6190:b0:59e:2c7a:1ae0 with SMTP id 2adb3069b0e04-59e640175b2mr445918e87.13.1770876819367; Wed, 11 Feb 2026 22:13:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dilip Kumar Date: Thu, 12 Feb 2026 11:43:22 +0530 X-Gm-Features: AZwV_QiReQD7gn36KjSp9HVeIYua2cQNVZEYbvij6VBrZchcqByyevm0WCuayXI Message-ID: Subject: Re: Patch: dumping tables data in multiple chunks in pg_dump To: Hannu Krosing Cc: David Rowley , Zsolt Parragi , Ashutosh Bapat , PostgreSQL Hackers , Nathan Bossart Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jan 28, 2026 at 11:00=E2=80=AFPM Hannu Krosing = wrote: > > v13 has added a proper test comparing original and restored table data > I was reviewing v13 and here are some initial comments I have 1. IMHO the commit message details about the work progress instead of a high level idea about what it actually does and how. Suggestion: SUBJECT: Add --max-table-segment-pages option to pg_dump for parallel table dumping. This patch introduces the ability to split large heap tables into segments based on a specified number of pages. These segments can then be dumped in parallel using the existing jobs infrastructure, significantly reducing the time required to dump very large tables. The implementation uses ctid-based range queries (e.g., WHERE ctid >=3D '(start,1)' AND ctid <=3D '(end,32000)') to extract specific chunks of the relation. 2. + pg_log_warning("CHUNKING: set dopt.max_table_segment_pages to [%u]", dopt.max_table_segment_pages); + break; IMHO we don't need to place warning here while processing the input paramet= ers 3. + printf(_(" --max-table-segment-pages=3DNUMPAGES\n" + " Number of main table pages above which data is \n" + " copied out in chunks, also determines the chunk size\n")); Check the comment formatting, all the parameter description starts with lower case, so better we start with "number" rather than "Number" 4. + if (is_segment(tdinfo)) + { + appendPQExpBufferStr(q, tdinfo->filtercond?" AND ":" WHERE "); + if(tdinfo->startPage =3D=3D 0) + appendPQExpBuffer(q, "ctid <=3D '(%u,32000)'", tdinfo->endPage); + else if(tdinfo->endPage !=3D InvalidBlockNumber) + appendPQExpBuffer(q, "ctid BETWEEN '(%u,1)' AND '(%u,32000)'", + tdinfo->startPage, tdinfo->endPage); + else + appendPQExpBuffer(q, "ctid >=3D '(%u,1)'", tdinfo->startPage); + pg_log_warning("CHUNKING: pages [%u:%u]",tdinfo->startPage, tdinfo->endPa= ge); + } IMHO we should explain this chunking logic in the comment above this code b= lock? -- Regards, Dilip Kumar Google