v1-0001-Remove-unnecessary-assignment-of-path-rows-in-gat.patch

application/octet-stream

Filename: v1-0001-Remove-unnecessary-assignment-of-path-rows-in-gat.patch
Type: application/octet-stream
Part: 1
Message: Possible incorrect row estimation for Gather paths

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v1-0001
Subject: Remove unnecessary assignment of path rows in gather merge
File+
src/backend/optimizer/util/pathnode.c 0 1
From 0c878b8cb3684f7673026d350a7aa9d29ef5033e Mon Sep 17 00:00:00 2001
From: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Date: Thu, 23 May 2024 09:24:04 +0200
Subject: Remove unnecessary assignment of path rows in gather merge

The number of rows of a gather merge node is set inside
cost_gather_merge, making the assignment in create_gather_merge_path
unnecessary and slightly misleading.

This patch removes the unnecessary assignment from
create_gather_merge_path, mirroring what's done in create_gather_path.
---
 src/backend/optimizer/util/pathnode.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 3491c3af1c..b4736d4986 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -1899,7 +1899,6 @@ create_gather_merge_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
 	pathnode->num_workers = subpath->parallel_workers;
 	pathnode->path.pathkeys = pathkeys;
 	pathnode->path.pathtarget = target ? target : rel->reltarget;
-	pathnode->path.rows += subpath->rows;
 
 	if (pathkeys_contained_in(pathkeys, subpath->pathkeys))
 	{
-- 
2.39.3 (Apple Git-146)