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 1vzaiJ-0018vr-1H for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2026 13:32:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vzaiH-00GQsG-2i for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2026 13:32:02 +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 1vzaiH-00GQrR-1f for pgsql-hackers@lists.postgresql.org; Mon, 09 Mar 2026 13:32:02 +0000 Received: from mail-dy1-x1336.google.com ([2607:f8b0:4864:20::1336]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vzai9-00000001nrG-0mWV for pgsql-hackers@postgresql.org; Mon, 09 Mar 2026 13:31:55 +0000 Received: by mail-dy1-x1336.google.com with SMTP id 5a478bee46e88-2be26d11b95so10143670eec.0 for ; Mon, 09 Mar 2026 06:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773063110; cv=none; d=google.com; s=arc-20240605; b=EXvE09Xa5gvTA3AmHQNXwf/2rb+Jkl72f4GvZKyQd1UDMsL6vqgwdRGtdVT9aZM3P1 GNEuw8KkNMQYWOAUfDxarumjOD/Dhc8ODKMHLkONr4j4z5bCvt7lkco7L1YPZ7SLjngE KwaO3mYYUGffMTi9xUFapBAIGW8iF5Luar+roV5VOcfdby9dmOG359iEeO0q7qq3WrAs 0Pbvgunhqqya6wS4/Q/i6xZqlqJmcYDzpR2zKGAYaa8dG9Es33jpqd7+CDvFMvqYh4n4 ETyAH3p4h7bxrvGHf9Ge7a3TBBIVOwBHt3HralZh4pa4lxmlYD9mK2a2V/cW3IbyAX5S 5Ryw== 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=RcjU0W5n3xgbZARMz14+HBVuM+ChKutuKHw2D/XyWH8=; fh=sD23g2oxdD1eSQkMJDJ10ByX9h2yYtT+AFGsB4YnRJ8=; b=eKbpSGjaEyCTm0FWS+QuZMHQzjTJYgNax4ISfQOq7SJwO0t1qvJJOVwSHpAsZdYuXK o+IL5Aiy5zmYKhUTllvwzMZ6kguon6RA7ndoXLnpyHetd7PlRzwNzZ/GOO84LtpUQyEF YDPIa+B0JLuYtM6+0J6zDtFzVKHME2wCBtz14xH5NWScdTiD/Rdz0R7tQgpCM3byXMGo G7TJTSQazl9qPgB+9RxZBzEuji8fVZhkRdU8GtJzopNVL3FbwFljpsacZUbkUFM73yHL 0xqdrgpS5ZBTeGKvVxRKoZHrvxXmkerWvMutGLTrusUT/XvMhFGoQvNt/mlvae3qiG3r u/GQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1773063110; x=1773667910; 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=RcjU0W5n3xgbZARMz14+HBVuM+ChKutuKHw2D/XyWH8=; b=blf9XDm+Bl2i0UqPY4xAfyumcKVJnMT6xvwZwuPSzugw5B39BHAS+l0Po85nCq9Q9D C2SeLckm1u0pN/ZIuVx+6XQBtEFy/HSNsweDqCHfr3R3cDq5UeFx1DgiLJ6cR+ZkYnOX WjqaWZhiBelWFXDppz72U+Vb9neVBWOGlByyCRkDyw12DiGblAZRID+WZelJyZ6TOOVj mtIWESfWaCN6N9WDPm6Uvp2/R0a3j1tPGT7saFoDhpd1UFmGVki5w3QEHBk9nHbRAhnQ hhrMy9BQK/eDkEPpzlvni+VKUJfMY3+GVV4ZhMWfmABJXeAF51m7YqKBPDMz17niwuQ0 7ePg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773063110; x=1773667910; 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=RcjU0W5n3xgbZARMz14+HBVuM+ChKutuKHw2D/XyWH8=; b=bQkEHT7RVI8ChP7thzVMtIp5TrL9+V4A1GA7JeHw94JFZP5qbS7V4dHrdOQBmOMB53 Ye9BJQC/BIJVfcY+lVl7fbSr6RS8lCXBOrF1CSl9fPBZesu+wQMC2xCiMEfwuBejm629 gvVfwMfBiLBmMqh1UO/DHl2NY7h866WOooN9xoO4sWip9GcI+43ChUWX38mwTrrY7nON TLb0Zvgj5/DeUfuzVly516enl8jl4+2qQOjoaiS5y+v2e0Rg7SYXOIjnYmSX9skjNWDl tTw5BXIvW8bw/1hHCKUFonw5lPc5gW3pULB/53U0KiuGtnxLM3cA46X1FNCdndOP1kB+ c1PQ== X-Forwarded-Encrypted: i=1; AJvYcCU9FpvxSoOOi2ZrjGvLGrHW8Q0JinDJWo38DJanupeXoQFRdNfwJN2IPVaa7MjO+ruQ+3KcEN0tB7lhmay4@postgresql.org X-Gm-Message-State: AOJu0YyuUyp0cZ9qoVNmmTyedt22y/nJRZN65Hx6w6pnOdoQr4WjyGxC ePq+2fnE7GjMHw32OjqQZu5sSS2uIZslAWwkDekfdgFTdcrc6RrLPj3ivO6Pd1Im+5BDj55KYxg rf+YMnak3yGUkyWByo3pVXpv93kf34vdS0nezZDUS X-Gm-Gg: ATEYQzyV+IIIr2oHd87DICs9AUu0DFq/yz061OX2O0s23LGdp9W0Yp3W9L03QBcKO/f 61XtaeLOYE9HHgtBNIZbKRBeKkfn1wam8Fjfj+VBB0LbAhhxFOWGBAnrJXp/nwIDwIHnPJ8Y0SX M0B/QdSl4084xHuRue/CssF6KTJlTyBY+vkbdkZag9uRcdvOtrk7l9iz2fw2SbMvkrB9l/wcZAk GqIDdl8DWpnr3TJYFfKioCWcQFCEO8ykVve3p+9168fuGPszz8kG3X6pYOi3OQsgcWa1pAfnkFg 7C7DWCsK X-Received: by 2002:a05:7300:2393:b0:2be:6a7:d551 with SMTP id 5a478bee46e88-2be4de90be0mr4957643eec.7.1773063110337; Mon, 09 Mar 2026 06:31:50 -0700 (PDT) MIME-Version: 1.0 References: <91acb778-42c4-44ef-8888-f18ad9b12a5b@dunslane.net> In-Reply-To: From: Manni Wood Date: Mon, 9 Mar 2026 08:31:39 -0500 X-Gm-Features: AaiRm51gG87DQEL3lFzHqy5WaT-bsn4BalNoX-3f1UeYn-ianlorkxtYdTP4tJU Message-ID: Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD To: Nazir Bilal Yavuz Cc: KAZAR Ayoub , Nathan Bossart , Andrew Dunstan , Neil Conway , Shinya Kato , PostgreSQL-development Content-Type: multipart/alternative; boundary="000000000000db38af064c976c04" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000db38af064c976c04 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 9, 2026 at 3:10=E2=80=AFAM Nazir Bilal Yavuz wrote: > Hi, > > On Sun, 8 Mar 2026 at 22:45, Manni Wood > wrote: > > > > As requested, here are some numbers based on the latest master but with > the copy code inlining excised (`git revert > dc592a41557b072178f1798700bf9c69cd8e4235`), compared to master with copy > code inlining left in place and the v11 patch applied. > > Both results have lz4 compression in place. > > Thank you for the benchmark! > > > I have not run numbers without lz4. I assume I could use the two > postgres instances that I have compiled with lz4, but just set > `default_toast_compression =3D pglz` in postgesql.conf for both instances= . > Let me know if that is a mistaken assumption on my part. > > I am a bit confused. Are you asking that for the current benchmark you > shared or future benchmarks? I assume your current benchmark has > 'default_toast_compression =3D lz4' because your benchmark results are > very similar to my benchmark with 'default_toast_compression =3D lz4' > but I just wanted to make sure. > > What you said about editing postgresql.conf is correct but you need to > make this change before creating the Postgres instance with 'pg_ctl > ... start' command, otherwise it won't have an effect and you need to > restart the instance to see the effect. Also, If you want to benchmark > without lz4 change, you can just use the "SET > default_toast_compression to 'pglz';" command in psql, then you don't > need to edit postgresql.conf. Please note that this will affect only > the psql instance you typed the command. To make things easier, you > can run the 'SHOW default_toast_compression;' command to see the > current value of 'default_toast_compression'. > > -- > Regards, > Nazir Bilal Yavuz > Microsoft > Hello, Nazir! I was being too brief. The benchmarks I shared were absolutely with lz4 compiled in and 'default_toast_compression =3D lz4' set in postgresql.conf for every postgres instance I tested with. (Furthermore, I ran `show default_toast_compression` via `psql` on each postgres instance to be sure 'default_toast_compression =3D lz4' was really set!) Also, all were compiled using meson using `debugoptimized` which results in `-g -O2`. So those are the benchmarks that I shared. OK, so my final question, hopefully clarified: If I run additional benchmarks where pglz is used for default_toast_compression, is it enough to use the instances I have already compiled with lz4 in them, but with 'default_toast_compression =3D pglz` explicitly set in postgresql.conf in a brand new data dir created by initdb? (In other words, existing data dir deleted, then initdb run to make a new data dir, then postgresql.conf edited to ensure 'default_toast_compression =3D pglz` explicitly set, then and only then starting up the cluster for the first time... and finally verifying via `show default_toast_compression` for good measure.) Or should I re-compile with the lz4-is-now-the-default commit completely excised? Thanks so much! -Manni -- -- Manni Wood EDB: https://www.enterprisedb.com --000000000000db38af064c976c04 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Mar 9, = 2026 at 3:10=E2=80=AFAM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
Hi,

On Sun, 8 Mar 2026 at 22:45, Manni Wood <manni.wood@enterprisedb.com> wrote= :
>
> As requested, here are some numbers based on the latest master but wit= h the copy code inlining excised (`git revert dc592a41557b072178f1798700bf9= c69cd8e4235`), compared to master with copy code inlining left in place and= the v11 patch applied.
> Both results have lz4 compression in place.

Thank you for the benchmark!

> I have not run numbers without lz4. I assume I could use the two postg= res instances that I have compiled with lz4, but just set `default_toast_co= mpression =3D pglz` in postgesql.conf for both instances. Let me know if th= at is a mistaken assumption on my part.

I am a bit confused. Are you asking that for the current benchmark you
shared or future benchmarks? I assume your current benchmark has
'default_toast_compression =3D lz4' because your benchmark results = are
very similar to my benchmark with 'default_toast_compression =3D lz4= 9;
but I just wanted to make sure.

What you said about editing postgresql.conf is correct but you need to
make this change before creating the Postgres instance with 'pg_ctl
... start' command, otherwise it won't have an effect and you need = to
restart the instance to see the effect. Also, If you want to benchmark
without lz4 change, you can just use the "SET
default_toast_compression to 'pglz';" command in psql, then yo= u don't
need to edit postgresql.conf. Please note that this will affect only
the psql instance you typed the command. To make things easier, you
can run the 'SHOW default_toast_compression;' command to see the current value of 'default_toast_compression'.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Hello, Nazir!

I was being too brief.

The benchm= arks I shared were absolutely with lz4 compiled in and=C2=A0'default_to= ast_compression =3D lz4' set in postgresql.conf for every postgres inst= ance I tested with. (Furthermore, I ran `show default_toast_compression` vi= a `psql` on each postgres instance to be sure=C2=A0'default_toast_compr= ession =3D lz4' was really set!)

Also, all wer= e compiled using meson using `debugoptimized` which results in `-g -O2`.

So those are the benchmarks that I shared.

OK, so my final question, hopefully clarified: If I run add= itional benchmarks where pglz is used for default_toast_compression, is it = enough to use the instances I have already compiled with lz4 in them, but w= ith=C2=A0'default_toast_compression =3D pglz` explicitly set in postgre= sql.conf in a brand new data dir created by initdb? (In other words, existi= ng data dir deleted, then initdb run to make a new data dir, then postgresq= l.conf edited to ensure 'default_toast_compression =3D pglz` explicitly= set, then and only then starting up the cluster for the first time... and = finally verifying via `show default_toast_compression` for good measure.)

Or should I re-compile with the lz4-is-now-the-defa= ult commit completely excised?

Thanks so much!

-Manni

--
-- Manni Wood EDB: https://www.enterprisedb.com
--000000000000db38af064c976c04--