Skip to content

Latest commit

 

History

History
76 lines (48 loc) · 3.37 KB

20231019_01.md

File metadata and controls

76 lines (48 loc) · 3.37 KB

PostgreSQL 16 preview - Count write times when extending relation files for shared buffers

作者

digoal

日期

2023-10-19

标签

PostgreSQL , PolarDB , iotiming 统计


背景

算是个bugfix, Relation files extended by multiple blocks 漏计算了EXTEND时间.

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d17ffc734dad8c231ad3deee0b3670ecb99b713d

Count write times when extending relation files for shared buffers  
  
author	Michael Paquier <michael@paquier.xyz>	  
Wed, 18 Oct 2023 05:54:33 +0000 (14:54 +0900)  
committer	Michael Paquier <michael@paquier.xyz>	  
Wed, 18 Oct 2023 05:54:33 +0000 (14:54 +0900)  
commit	d17ffc734dad8c231ad3deee0b3670ecb99b713d  
tree	d93366c5543400a617d8ce6688f52753a16616ce	tree  
parent	173b56f1ef597251fe79d8e71a0df7586ea12549	commit | diff  
Count write times when extending relation files for shared buffers  
  
Relation files extended by multiple blocks at a time have been counting  
the number of blocks written, but forgot to increment the write time in  
this case, as single-block write and relation extension are treated as  
two different I/O operations in the shared stats: IOOP_EXTEND vs  
IOOP_WRITE.  In this case IOOP_EXTEND was forgotten for normal  
(non-temporary) relations, still the number of blocks written was  
incremented according to the relation extend done.  
  
Write times are tracked when track_io_timing is enabled, which is not  
the case by default.  
  
Author: Nazir Bilal Yavuz  
Reviewed-by: Robert Haas, Melanie Plageman  
Discussion: https://postgr.es/m/CAN55FZ19Ss279mZuqGbuUNxka0iPbLgYuOQXqAKewrjNrp27VA@mail.gmail.com  
Backpatch-through: 16  

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blobdiff;f=src/backend/utils/activity/pgstat_io.c;h=8ec8670199720083a5cd02ac8b0d2a8557109ada;hp=eb7d35d4225a62752faa228c4a351d27fc7dce9e;hb=d17ffc734dad8c231ad3deee0b3670ecb99b713d;hpb=173b56f1ef597251fe79d8e71a0df7586ea12549

-       if (io_op == IOOP_WRITE)  
+       if (io_op == IOOP_WRITE || io_op == IOOP_EXTEND)  

digoal's wechat