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 1vi9IL-00GSQL-0d for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 10:49:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vi9IJ-000WDa-3C for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 10:49:08 +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.96) (envelope-from ) id 1vi9IJ-000WDS-1r for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 10:49:08 +0000 Received: from mail-dy1-x1343.google.com ([2607:f8b0:4864:20::1343]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vi9IH-001PHO-0H for pgsql-hackers@postgresql.org; Tue, 20 Jan 2026 10:49:07 +0000 Received: by mail-dy1-x1343.google.com with SMTP id 5a478bee46e88-2b1981ca515so5615394eec.1 for ; Tue, 20 Jan 2026 02:49:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768906145; cv=none; d=google.com; s=arc-20240605; b=XHlFWbwEqqM9lDbFajbWezBsqJNSot2vMb4QBxf26N9XBc1p9CagHz9IZ9GVxNkmW9 gsvw+GM7TZSINMVzMeXRi4VJHef4Ay5Pi7WH8Qz3aNxBmcawiJ3GwaefQ2qc8+APXJaN obuZRem2dCluHBW/7aWtLOu6NNQSAA7ids/7AdLfjQcH4jNCnKsPejFQe1h2cwtqU899 gdPHrZHoCQUZtl/1dEkX9AeCg9KOcCxKuCijMbF7S3ecnCDTrBb1XIXcokVz1XKRFA15 mK5f9TQedEzyyt/cdozyaiLh8OA4EnTZyyd7X/3ckGdnLsfoKCgOLXcKa1YxyfQ6DnhJ HgPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=RtQOn9EMXa04IujN4kKiMkZP+kfWih90olhsDEkHYGA=; fh=+h+OiNJZFJDd8F/fJXUi97xsrzFUIYirtQT6Xvi+3E8=; b=fcEPXeEGcZO6ykPcUPiil+DtU+hEp83IENcrU2RFlUcVB/AGYimQGMea9LW1YSFDGv BootezbPf2yMZGrSC24zDEEZS1ntvOsRRfpgLPI5UEgS2Z0qXgfricoy9W5Kjq7qmIDF YS9lfzrzsOfAxDcxoKCY05ANS1+PeJwNQM5Bk6UR+2m2sNW73imGKJnCHOBTJtTvtwJ0 C/7w/GwXV6gRrbsuQ7erhL4KvLxMkAon9ZqvpmqsWFHg9qDCW2W1e9PgzGsp0DIHcMUE vnyEPJNerfTKDwDaTYiQ2sf/EAMx7laMdn1LuO6GVTo364kL0atFes/444XfcDP7tK+z uYyw==; darn=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=1768906145; x=1769510945; darn=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=RtQOn9EMXa04IujN4kKiMkZP+kfWih90olhsDEkHYGA=; b=KSHLpKkpRfn5oin4nIgPxV4k+OAD4HfjePCWcVvheoI3JehqyCGAksRzzupucfjOdN EhxBAwZs2Fvsg5ND9YD6EtD684t3w9Qnmi1nOub165kxmuBjjgNzJwdZfTK13NRJ9yyo d9n20qvKG+9zg9U1Fa5FHywX2dncpDORfc2r9UnTNNhi/V1/kMW6o9djJRBx7lqzyr45 pltbnSosx+A4O+zLi/otKn7WKfFrffiG/Xiivqh003LRNtkmcvh9Iw+T5xZmdsnZ/lxT /maVIMqBuiWaFqwrT0JTb5JGnr/CDuh58mpXB4OD/f38ixi257T3JvVXEE1Hc733+YeA Jsqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768906145; x=1769510945; h=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=RtQOn9EMXa04IujN4kKiMkZP+kfWih90olhsDEkHYGA=; b=SEsmty0/bPKGBq2xAp8jcPGmGykzwmhTU2csGbw+Khjgh0rj4G8YvIH/2meEvdzv+G 9Zw32GvQmlax9hiWrVS6QcUp3P0B/jENN2xApF6OwLqZbTBYBYK/hgoewrFgGCC7YLXk 1bWT6Uwh/xWBcQhIHfTlCwsqMT+4bHR1wA4XhlJUoo47UHgButOmLKv+dN38KgLOs2PI M8aH/r/S41TZcfd8Hibm7YrO+uR0u8327ptWw9fssjwiqnfxEHy0w1QA2Hyo2mCZBVOG n/KTu/pC4cPTtHkOxpw20+1dSOlUJ0ySRpOtncXownpJtQyeSM7zNHgsftU0sUxeCjaD AaWg== X-Forwarded-Encrypted: i=1; AJvYcCVwGOYj739D4dO08Ey51nyXR615g8Icn/PzOopkRWcpiDrhMoLVi32cmEAvC7EP4b0NtPKfgCiB9yXUgMB/@postgresql.org X-Gm-Message-State: AOJu0YzCp91CwdGN+aboTbv9wBehW+e94tX3tPQ/mm6z20azjEPyoiML xkXB9fnDvapfAKbwX6stYcxZzY7LfN46bd70YYQgiTE2gQiW5u9l/4fD6S8jacvn0/QwgKMBshx nyi6BXNc+jpkApyp4MzqhLzDWN5LdCo0= X-Gm-Gg: AZuq6aL6A4HaPKdTF04T8MkdvuuOjJL+DdeOIZHU2HvlqGhngAfregUC/6YJY1w+ppz DqI6BOcMvO7skFg9TVDl1PMkMtD4qhsJkfI6Fz+DfJUfZ4NHdY7IVbIfadJ+UemDhB5F1upFMJc hE0bYGtPXCQTRs3HqbkMpFTMi+hm9UHc7pZsNs/vm5mVz4l3KoUtX7wt0NJ3mUNI9tz/ep2dncs Zk3cMs4JNbeBxpmB0tpSKz1AWykUzUTcf4/Dj+TSWlhbGbxcCXG9q2RV9oYSJfwOFJcPpg= X-Received: by 2002:a05:7300:3b24:b0:2ae:5bd5:c22e with SMTP id 5a478bee46e88-2b6fd7c5c87mr621410eec.30.1768906144630; Tue, 20 Jan 2026 02:49:04 -0800 (PST) MIME-Version: 1.0 References: <7bcc0420-d457-4af5-a459-a4e5d929a665@vondra.me> <7gbzkoxrpqvj2sgxof4pqirz7pf6wb5vizak3mxrz2zpvrf3pa@lvnwdsy3em56> In-Reply-To: From: lakshmi Date: Tue, 20 Jan 2026 16:21:14 +0530 X-Gm-Features: AZwV_QjGvlPly3WlyK3trd2RGy-PAcIpp07H0XBPl1NW_Ma_2ZIxEODv7bR-q9U Message-ID: Subject: Re: Proposal: Adding compression of temporary files To: Filip Janus Cc: Tomas Vondra , pgsql-hackers@postgresql.org, zsolt.parragi@percona.com Content-Type: multipart/alternative; boundary="000000000000644d0e0648cf8ed6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000644d0e0648cf8ed6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Filip, I tested both patches on current master using git am -3 .They apply cleanly,build fine,and the temp_file _compression GUC works as expected. Query results are unchanged. For hash join spill test,temp files were created as expected,but the logged size were same for no,lz4,and pglz,which seems consistent with fixed-size fileset chunking.It might be helpful to briefly note this in the documentation to avoid confusion. Thanks for working on this . best regards, lakshmi On Tue, Jan 20, 2026 at 4:10=E2=80=AFAM Zsolt Parragi wrote: > Hello! > > I tried to review the code. It compiled, the test suite passed. > > I noticed two typos: > > buffile.c:77 - "Disaled" > buffile.c:133 - "mathods" > > And a few other small findings: > > buffile.h:35 and buffile.c:63 - same constants defined first as an > Enum and then as #defines - code builds properly without the defines. > > buffile.c:121 - compress_tempfile is defined, set to false at :167, > but never used otherwise > > guc_tables.c:470 - the comment says that pglz isn't supported yet, but > we have a value for it, and I see support for it in the code > > buffile.c:659: (and at other places) if USE_LZ4 is undefined, the > codepath doesn't do anything. I think these ifdefs should follow how > other compression code works, such as wal compression where there's an > #else path with elog(ERROR, ...) > Similarly, maybe there should be an explicit TEMP_NONE_COMPRESSION > branch that does nothing, and the default branch should be an error? > > buffile.c:265: If seek isn't supported/limited, shouldn't there be at > least an assertion about it in BufFileSeek? And tell isn't mentioned, > but it seems to me that tell also doesn't work properly. > --000000000000644d0e0648cf8ed6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Filip,

I tested both patches on current master u= sing git am -3 .They apply cleanly,build fine,and the temp_file _compressio= n GUC works as expected.
Query results are unchanged.

For hash jo= in spill test,temp files were created as expected,but the logged size were = same for no,lz4,and pglz,which seems consistent with fixed-size fileset chu= nking.It might be helpful to briefly note this in the documentation to avoi= d confusion.

Thanks for working on this .
best regards,
lakshm= i

On Tue, Jan 20, 2026 at 4:10=E2=80=AFAM Zsolt Parrag= i <zsolt.parragi@percona.co= m> wrote:
Hello!

I tried to review the code. It compiled, the test suite passed.

I noticed two typos:

buffile.c:77 - "Disaled"
buffile.c:133 - "mathods"

And a few other small findings:

buffile.h:35 and buffile.c:63 - same constants defined first as an
Enum and then as #defines - code builds properly without the defines.

buffile.c:121 - compress_tempfile is defined, set to false at :167,
but never used otherwise

guc_tables.c:470 - the comment says that pglz isn't supported yet, but<= br> we have a value for it, and I see support for it in the code

buffile.c:659: (and at other places) if USE_LZ4 is undefined, the
codepath doesn't do anything. I think these ifdefs should follow how other compression code works, such as wal compression where there's an<= br> #else path with elog(ERROR, ...)
Similarly, maybe there should be an explicit TEMP_NONE_COMPRESSION
branch that does nothing, and the default branch should be an error?

buffile.c:265: If seek isn't supported/limited, shouldn't there be = at
least an assertion about it in BufFileSeek? And tell isn't mentioned, but it seems to me that tell also doesn't work properly.
--000000000000644d0e0648cf8ed6--