v17-0017-WIP-instrumentation-Account-for-resource-usage-u.patch
application/octet-stream
Filename: v17-0017-WIP-instrumentation-Account-for-resource-usage-u.patch
Type: application/octet-stream
Part: 1
Message:
Re: index prefetching
Patch
Format: format-patch
Series: patch v17-0017
Subject: WIP: instrumentation: Account for resource usage uring rescans
| File | + | − |
|---|---|---|
| src/backend/executor/execAmi.c | 17 | 2 |
From 5f6c2da75c8c64d823b2224aa2ad2ac2c55c93c2 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Thu, 19 Mar 2026 23:08:29 -0400
Subject: [PATCH v17 17/18] WIP: instrumentation: Account for resource usage
uring rescans
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/backend/executor/execAmi.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c
index 979a852fe..03939521b 100644
--- a/src/backend/executor/execAmi.c
+++ b/src/backend/executor/execAmi.c
@@ -77,9 +77,15 @@ static bool IndexSupportsBackwardScan(Oid indexid);
void
ExecReScan(PlanState *node)
{
- /* If collecting timing stats, update them */
if (node->instrument)
- InstrEndLoop(node->instrument);
+ {
+ /*
+ * Rescan in some node types can take long enough to be worth
+ * accounting for.
+ */
+ if (node->instrument->running)
+ InstrStartNode(node->instrument);
+ }
/*
* If we have changed parameters, propagate that info.
@@ -309,6 +315,15 @@ ExecReScan(PlanState *node)
bms_free(node->chgParam);
node->chgParam = NULL;
}
+
+ if (node->instrument)
+ {
+ if (node->instrument->running)
+ InstrStopNode(node->instrument, 0);
+
+ /* If collecting timing stats, update them */
+ InstrEndLoop(node->instrument);
+ }
}
/*
--
2.53.0