agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Dmitrii Dolgov <9erthalion6@gmail.com>
Subject: [PATCH v2 2/3] Add USDT for split location benchmarking
Date: Mon, 15 Jun 2026 16:39:29 +0200

Add new USDTs probe nbtree__page__findsplit__(start / done) for
benchmarking of split logic.
---
 src/backend/access/nbtree/nbtsplitloc.c | 5 +++++
 src/backend/utils/probes.d              | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/src/backend/access/nbtree/nbtsplitloc.c b/src/backend/access/nbtree/nbtsplitloc.c
index de9eca3c8b2..c64fef5ab27 100644
--- a/src/backend/access/nbtree/nbtsplitloc.c
+++ b/src/backend/access/nbtree/nbtsplitloc.c
@@ -17,6 +17,7 @@
 #include "access/nbtree.h"
 #include "access/tableam.h"
 #include "common/int.h"
+#include "pg_trace.h"
 
 typedef enum
 {
@@ -152,6 +153,8 @@ _bt_findsplitloc(Relation rel,
 	SplitPoint	leftpage,
 				rightpage;
 
+	TRACE_POSTGRESQL_NBTREE_PAGE_FINDSPLIT_START(origpage);
+
 	opaque = BTPageGetOpaque(origpage);
 	maxoff = PageGetMaxOffsetNumber(origpage);
 
@@ -425,6 +428,8 @@ _bt_findsplitloc(Relation rel,
 									 strategy);
 	pfree(state.splits);
 
+	TRACE_POSTGRESQL_NBTREE_PAGE_FINDSPLIT_DONE(origpage);
+
 	return firstrightoff;
 }
 
diff --git a/src/backend/utils/probes.d b/src/backend/utils/probes.d
index d827ed0201c..b90b708d862 100644
--- a/src/backend/utils/probes.d
+++ b/src/backend/utils/probes.d
@@ -94,4 +94,7 @@ provider postgresql {
 
 	probe nbtree__page__split(BlockNumber);
 	probe nbtree__page__truncate(int);
+
+	probe nbtree__page__findsplit__start(Page);
+	probe nbtree__page__findsplit__done(Page);
 };
-- 
2.52.0


--hfljrm32b5osvvug
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment;
	filename="v2-0003-Randomize-nbtree-split-location-to-avoid-oscillat.patch"
Content-Transfer-Encoding: 8bit



view thread (133+ messages)  latest in thread

Message-ID: <no-message-id-1494832@localhost>
Permalink:  ../no-message-id-1494832@localhost/
Also on:    postgresql.org/message-id/no-message-id-1494832@localhost

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: 9erthalion6@gmail.com
  Subject: Re: [PATCH v2 2/3] Add USDT for split location benchmarking
  In-Reply-To: <no-message-id-1494832@localhost>

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

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