RE: COPY performance on Windows - Mailing list pgsql-hackers

From Ryohei Takahashi (Fujitsu)
Subject RE: COPY performance on Windows
Date
Msg-id TY3PR01MB1189178759FA74DB8E508533B82182@TY3PR01MB11891.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: COPY performance on Windows  ("Ryohei Takahashi (Fujitsu)" <r.takahashi_2@fujitsu.com>)
List pgsql-hackers
Hi,


I compared the performance between 94f9c08 (previous commit of 82a4edabd2) and 82a4edabd2 with nclient = 8.
The performance is degraded by 8%.


* 94f9c08 (previous commit of 82a4edabd2) 
75sec

* 82a4edabd2
81sec


I looked the pg_stat_io view after COPY completed.


* 94f9c08 (previous commit of 82a4edabd2) 
    backend_type     |    object     |  context  | reads | read_time | writes  | write_time | writebacks |
writeback_time| extends |    extend_time     | op_bytes |   hits   | evictions | reuses  | fsyncs | fsync_time |
stats_reset
 client backend      | relation      | bulkwrite |     0 |         0 | 4408399 |  57207.667 |          0 |
0| 4424783 | 43897.679000000004 |     8192 |  6559989 |         0 | 4408399 |        |            | 2025-01-14
13:57:29.162001+09


* 82a4edabd2
    backend_type     |    object     |  context  | reads | read_time | writes  | write_time | writebacks |
writeback_time| extends | extend_time | op_bytes |  hits   | evictions | reuses  | fsyncs | fsync_time |
stats_reset
 client backend      | relation      | bulkwrite |     0 |         0 | 4408514 | 112722.993 |          0 |
0| 4424898 |   33416.076 |     8192 | 5245654 |         0 | 4408514 |        |            | 2025-01-14
13:54:40.643054+09



By applying 82a4edabd2, extend_time is reduced from 43897ms to 33416ms.
It seems it is the effect of 82a4edabd2.

On the other hand, write_time is increased from 57207ms to 112722ms.
I think write_time is just the time for pwrite(), so I cannot understand why 82a4edabd2 affects write_time.


How do you think about this?


Regards,
Ryohei Takahashi

pgsql-hackers by date:

Previous
From: "Ryohei Takahashi (Fujitsu)"
Date:
Subject: RE: COPY performance on Windows
Next
From: Shubham Khanna
Date:
Subject: Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size