10000 Fix progress calculation for the Filter node. · postgrespro/pg_query_state@4405ce7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4405ce7

Browse files
author
Ekaterina Sokolova
committed
Fix progress calculation for the Filter node.
1 parent 8ad70f8 commit 4405ce7

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# contrib/pg_query_state/Makefile
33

44
MODULE_big = pg_query_state
5-
OBJS = pg_query_state.o signal_handler.o progress_bar.o $(WIN32RES)
5+
OBJS = pg_query_state.o signal_handler.o $(WIN32RES)
66
EXTENSION = pg_query_state
77
EXTVERSION = 1.1
88
DATA = pg_query_state--1.0--1.1.sql

pg_query_state.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,24 +1280,20 @@ CountProgress(char *plan_text)
12801280
{
12811281
if ((rows = strstr(node, "Rows Removed by Filter")) != NULL)
12821282
{
1283+
node_amount++;
1284+
rows = (char *) (rows + strlen("Rows Removed by Filter\": ") * sizeof(char));
1285+
12831286
/*
12841287
* Filter node have 2 conditions:
12851288
* 1) Was not filtered (current progress = 0)
12861289
* 2) Was filtered (current progress = 1)
12871290
*/
1288-
node_amount++;
1289-
plan_rows = 1;
1290-
rows = (char *) (rows + strlen("Rows Removed by Filter\": ") * sizeof(char));
1291-
if (rows[0] == '0')
1292-
actual_rows = 0;
1293-
else
1294-
actual_rows = 1;
1295-
} else if ((rows = strstr(node, "\"Actual Rows\": ")) != NULL)
1291+
if (rows[0] != '0')
1292+
progress += 1;
1293+
}
1294+
else if ((rows = strstr(node, "\"Actual Rows\": ")) != NULL)
12961295
{
12971296
node_amount++;
1298-
actual_rows = 0;
1299-
plan_rows = 0;
1300-
13011297
rows = (char *) (rows + strlen("\"Actual Rows\": ") * sizeof(char));
13021298
len = strstr(rows, "\n") - rows;
13031299
if ((strstr(rows, ",") - rows) < len)

0 commit comments

Comments
 (0)
0