pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: KAZAR Ayoub <ma_kazar@esi.dz>
Cc: Andres Freund <andres@anarazel.de>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Neil Conway <neil.conway@gmail.com>
Cc: Manni Wood <manni.wood@enterprisedb.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Shinya Kato <shinya11.kato@gmail.com>
Cc: Mark Wong <markwkm@gmail.com>
Cc: Nazir Bilal Yavuz <byavuz81@gmail.com>
Subject: Re: Speed up COPY TO text/CSV parsing using SIMD
Date: Thu, 26 Mar 2026 16:09:23 -0500
Message-ID: <acWgg0cG7MALI2hB@nathan> (raw)
In-Reply-To: <CA+K2Rum-TB_iNzDWoXOJspf=jq0gd-wees8+9tBTJNyhy9cK5g@mail.gmail.com>
References: <CA+K2Runi_H2CBL0yMm3De2KqcR9RMA0HK5cLJjEhoNszC7myeg@mail.gmail.com>
	<aY5C6Xa5im72NF_Y@alap3.anarazel.de>
	<CA+K2Rum_QTZqTUrdMOL5hr-OOpCwGR_9Nj1z15BFObjktMOY6A@mail.gmail.com>
	<abBuKalOno33MQFw@nathan>
	<CA+K2Rum7+Jm2rm65K5msxaiAM8QTkhSNAYarPBP9O7nBXYo12Q@mail.gmail.com>
	<abmiNPQOqBrRlf_m@nathan>
	<CA+K2Rum-TB_iNzDWoXOJspf=jq0gd-wees8+9tBTJNyhy9cK5g@mail.gmail.com>

On Wed, Mar 18, 2026 at 12:02:28AM +0100, KAZAR Ayoub wrote:
>   Test                 Master    v3       v3_var   v3_var_noinl
>   TEXT clean           1504ms   -24.1%   -23.0%   -21.5%
>   CSV clean            1760ms   -34.9%   -32.7%   -33.0%

Nice!

>   TEXT 1/3 backslashes     3763ms    +4.6%    +6.9%   +4.1%
>   CSV 1/3 quotes           3885ms    +3.1%    +2.7%    -0.8%

Hm.  These seem a little bit beyond what we could ignore as noise.

> Wide table TEXT (integer columns):
> 
>   Cols    Master    v3       v3_var   v3_var_noinl
>   50      2083ms   -0.7%    -0.6%    +3.5%
>   100     4094ms   -0.1%    -0.5%    +4.5%
>   200     1560ms   +0.6%    -2.3%    +3.2%
>   500     1905ms   -1.0%    -1.3%    +4.7%
>   1000    1455ms   +1.8%    +0.4%    +4.3%

These numbers look roughly within the noise range.

> Wide table CSV:
> 
>   Cols    Master    v3       v3_var   v3_var_noinl
>   50      2421ms   +4.0%    +6.7%    +5.8%

Hm.  Is this reproducible?  A 4% regression is a bit worrisome.

>   100     4980ms   +0.1%    +2.0%     +0.1%
>   200     1901ms   +1.4%    +3.5%    +1.4%
>   500     2328ms   +1.8%    +2.7%    +2.2%
>   1000    1815ms   +2.0%    +2.8%    +2.5%

These numbers don't bother me too much, but maybe there are some ways to
minimize the regressions further.

-- 
nathan





view thread (18+ messages)  latest in thread

Message-ID: <acWgg0cG7MALI2hB@nathan>
Permalink:  ../acWgg0cG7MALI2hB@nathan/
Also on:    postgresql.org/message-id/acWgg0cG7MALI2hB@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, ma_kazar@esi.dz, andres@anarazel.de, neil.conway@gmail.com, manni.wood@enterprisedb.com, andrew@dunslane.net, shinya11.kato@gmail.com, markwkm@gmail.com, byavuz81@gmail.com
  Subject: Re: Speed up COPY TO text/CSV parsing using SIMD
  In-Reply-To: <acWgg0cG7MALI2hB@nathan>
  References: <CA+K2Runi_H2CBL0yMm3De2KqcR9RMA0HK5cLJjEhoNszC7myeg@mail.gmail.com> <aY5C6Xa5im72NF_Y@alap3.anarazel.de> <CA+K2Rum_QTZqTUrdMOL5hr-OOpCwGR_9Nj1z15BFObjktMOY6A@mail.gmail.com> <abBuKalOno33MQFw@nathan> <CA+K2Rum7+Jm2rm65K5msxaiAM8QTkhSNAYarPBP9O7nBXYo12Q@mail.gmail.com> <abmiNPQOqBrRlf_m@nathan> <CA+K2Rum-TB_iNzDWoXOJspf=jq0gd-wees8+9tBTJNyhy9cK5g@mail.gmail.com> <acWgg0cG7MALI2hB@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox