pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sutou Kouhei <kou@clear-code.com>
To: zhjwpku@gmail.com
Cc: sawada.mshk@gmail.com
Cc: michael@paquier.xyz
Cc: pgsql-hackers@postgresql.org
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
Date: Thu, 28 Nov 2024 15:16:17 +0900 (JST)
Message-ID: <20241128.151617.1631851448884958406.kou@clear-code.com> (raw)
In-Reply-To: <CAEG8a3LUBcvjwqgt6AijJmg67YN_b_NZ4Kzoxc_dH4rpAq0pKg@mail.gmail.com>
References: <20241125.110620.313152541320718947.kou@clear-code.com>
	<20241125.150150.2272193296332028961.kou@clear-code.com>
	<CAEG8a3LUBcvjwqgt6AijJmg67YN_b_NZ4Kzoxc_dH4rpAq0pKg@mail.gmail.com>

Hi,

In <CAEG8a3LUBcvjwqgt6AijJmg67YN_b_NZ4Kzoxc_dH4rpAq0pKg@mail.gmail.com>
  "Re: Make COPY format extendable: Extract COPY TO format implementations" on Wed, 27 Nov 2024 19:49:17 +0800,
  Junwang Zhao <zhjwpku@gmail.com> wrote:

> I just gave this another round of benchmarking tests. I'd like to
> share the number,
> since COPY TO has some performance drawbacks, I test only COPY TO. I
> use the run.sh Tomas provided earlier but use pgbench with a custom script, you
> can find it here[0].
> 
> I tested 3 branches:
> 
> 1. the master branch
> 2. all v26 patch sets applied
> 3. Emitting JSON to file using COPY TO v13 patch set[1], this add some
> if branch in CopyOneRowTo, so I was expecting this slower than master
> 
> 2 can be about -3%~+3% compared to 1, but what surprised me is that 3
> is always better than 1 & 2.
> 
> I reviewed the patch set of 3 and I don't see any magic.
> 
> You can see the detailed results here[2], I can not upload files so I
> just shared the google doc link, ping me if you can not open the link.
> 
> [0]: https://github.com/pghacking/scripts/tree/main/extensible_copy
> [1]: https://www.postgresql.org/message-id/CACJufxH8J0uD-inukxAmd3TVwt-b-y7d7hLGSBdEdLXFGJLyDA%40mail.gma...
> [2]: https://docs.google.com/spreadsheets/d/1wJPXZF4LHe34X9IU1pLG7rI9sCkSy2dEkdj7w7avTqM/edit?usp=sharing

Thanks for sharing your numbers.

1. and 2. shows that there is at least no significant
performance regression.

I see the patch set of 3. and I think that the result
(there is no performance difference between 1. and 3.) isn't
strange. The patch set adds some if branches but they aren't
used with "text" format at least in per row process.

Thanks,
-- 
kou





view thread (340+ messages)  latest in thread

Message-ID: <20241128.151617.1631851448884958406.kou@clear-code.com>
Permalink:  ../20241128.151617.1631851448884958406.kou@clear-code.com/
Also on:    postgresql.org/message-id/20241128.151617.1631851448884958406.kou@clear-code.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: kou@clear-code.com, zhjwpku@gmail.com, sawada.mshk@gmail.com, michael@paquier.xyz
  Subject: Re: Make COPY format extendable: Extract COPY TO format implementations
  In-Reply-To: <20241128.151617.1631851448884958406.kou@clear-code.com>

* 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