Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas2025-02-27 16:25:18 +0000
committerRobert Haas2025-02-27 16:27:16 +0000
commit95dbd827f2edc4d10bebd7e840a0bd6782cf69b7 (patch)
tree583d6785493f5d92851a6c14a751299e954c7e60 /contrib/postgres_fdw
parentce62f2f2a0a48d021f250ba84dfcab5d45ddc914 (diff)
EXPLAIN: Always use two fractional digits for row counts.
Commit ddb17e387aa28d61521227377b00f997756b8a27 attempted to avoid confusing users by displaying digits after the decimal point only when nloops > 1, since it's impossible to have a fraction row count after a single iteration. However, this made the regression tests unstable since parallal queries will have nloops>1 for all nodes below the Gather or Gather Merge in normal cases, but if the workers don't start in time and the leader finishes all the work, they will suddenly have nloops==1, making it unpredictable whether the digits after the decimal point would be displayed or not. Although 44cbba9a7f51a3888d5087fc94b23614ba2b81f2 seemed to fix the immediate failures, it may still be the case that there are lower-probability failures elsewhere in the regression tests. Various fixes are possible here. For example, it has previously been proposed that we should try to display the digits after the decimal point only if rows/nloops is an integer, but currently rows is storead as a float so it's not theoretically an exact quantity -- precision could be lost in extreme cases. It has also been proposed that we should try to display the digits after the decimal point only if we're under some sort of construct that could potentially cause looping regardless of whether it actually does. While such ideas are not without merit, this patch adopts the much simpler solution of always display two decimal digits. If that approach stands up to scrutiny from the buildfarm and human users, it spares us the trouble of doing anything more complex; if not, we can reassess. This commit incidentally reverts 44cbba9a7f51a3888d5087fc94b23614ba2b81f2, which should no longer be needed. Author: Robert Haas <robertmhaas@gmail.com> Author: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com> Discussion: http://postgr.es/m/CA+TgmoazzVHn8sFOMFAEwoqBTDxKT45D7mvkyeHgqtoD2cn58Q@mail.gmail.com
Diffstat (limited to 'contrib/postgres_fdw')
-rw-r--r--contrib/postgres_fdw/expected/postgres_fdw.out60
1 files changed, 30 insertions, 30 deletions
diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out
index daa3b1d7a6d..8447b289cb7 100644
--- a/contrib/postgres_fdw/expected/postgres_fdw.out
+++ b/contrib/postgres_fdw/expected/postgres_fdw.out
@@ -11670,15 +11670,15 @@ SELECT * FROM local_tbl, async_pt WHERE local_tbl.a = async_pt.a AND local_tbl.c
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
SELECT * FROM local_tbl, async_pt WHERE local_tbl.a = async_pt.a AND local_tbl.c = 'bar';
- QUERY PLAN
--------------------------------------------------------------------------------
- Nested Loop (actual rows=1 loops=1)
- -> Seq Scan on local_tbl (actual rows=1 loops=1)
+ QUERY PLAN
+----------------------------------------------------------------------------------
+ Nested Loop (actual rows=1.00 loops=1)
+ -> Seq Scan on local_tbl (actual rows=1.00 loops=1)
Filter: (c = 'bar'::text)
Rows Removed by Filter: 1
- -> Append (actual rows=1 loops=1)
+ -> Append (actual rows=1.00 loops=1)
-> Async Foreign Scan on async_p1 async_pt_1 (never executed)
- -> Async Foreign Scan on async_p2 async_pt_2 (actual rows=1 loops=1)
+ -> Async Foreign Scan on async_p2 async_pt_2 (actual rows=1.00 loops=1)
-> Seq Scan on async_p3 async_pt_3 (never executed)
Filter: (a = local_tbl.a)
(9 rows)
@@ -11916,20 +11916,20 @@ SELECT * FROM local_tbl t1 LEFT JOIN (SELECT *, (SELECT count(*) FROM async_pt W
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
SELECT * FROM local_tbl t1 LEFT JOIN (SELECT *, (SELECT count(*) FROM async_pt WHERE a < 3000) FROM async_pt WHERE a < 3000) t2 ON t1.a = t2.a;
- QUERY PLAN
------------------------------------------------------------------------------------------
- Nested Loop Left Join (actual rows=1 loops=1)
+ QUERY PLAN
+--------------------------------------------------------------------------------------------
+ Nested Loop Left Join (actual rows=1.00 loops=1)
Join Filter: (t1.a = async_pt.a)
Rows Removed by Join Filter: 399
InitPlan 1
- -> Aggregate (actual rows=1 loops=1)
- -> Append (actual rows=400 loops=1)
- -> Async Foreign Scan on async_p1 async_pt_4 (actual rows=200 loops=1)
- -> Async Foreign Scan on async_p2 async_pt_5 (actual rows=200 loops=1)
- -> Seq Scan on local_tbl t1 (actual rows=1 loops=1)
- -> Append (actual rows=400 loops=1)
- -> Async Foreign Scan on async_p1 async_pt_1 (actual rows=200 loops=1)
- -> Async Foreign Scan on async_p2 async_pt_2 (actual rows=200 loops=1)
+ -> Aggregate (actual rows=1.00 loops=1)
+ -> Append (actual rows=400.00 loops=1)
+ -> Async Foreign Scan on async_p1 async_pt_4 (actual rows=200.00 loops=1)
+ -> Async Foreign Scan on async_p2 async_pt_5 (actual rows=200.00 loops=1)
+ -> Seq Scan on local_tbl t1 (actual rows=1.00 loops=1)
+ -> Append (actual rows=400.00 loops=1)
+ -> Async Foreign Scan on async_p1 async_pt_1 (actual rows=200.00 loops=1)
+ -> Async Foreign Scan on async_p2 async_pt_2 (actual rows=200.00 loops=1)
(12 rows)
SELECT * FROM local_tbl t1 LEFT JOIN (SELECT *, (SELECT count(*) FROM async_pt WHERE a < 3000) FROM async_pt WHERE a < 3000) t2 ON t1.a = t2.a;
@@ -11960,15 +11960,15 @@ SELECT * FROM async_pt t1 WHERE t1.b === 505 LIMIT 1;
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
SELECT * FROM async_pt t1 WHERE t1.b === 505 LIMIT 1;
- QUERY PLAN
--------------------------------------------------------------------------
- Limit (actual rows=1 loops=1)
- -> Append (actual rows=1 loops=1)
- -> Async Foreign Scan on async_p1 t1_1 (actual rows=0 loops=1)
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Limit (actual rows=1.00 loops=1)
+ -> Append (actual rows=1.00 loops=1)
+ -> Async Foreign Scan on async_p1 t1_1 (actual rows=0.00 loops=1)
Filter: (b === 505)
- -> Async Foreign Scan on async_p2 t1_2 (actual rows=0 loops=1)
+ -> Async Foreign Scan on async_p2 t1_2 (actual rows=0.00 loops=1)
Filter: (b === 505)
- -> Seq Scan on async_p3 t1_3 (actual rows=1 loops=1)
+ -> Seq Scan on async_p3 t1_3 (actual rows=1.00 loops=1)
Filter: (b === 505)
Rows Removed by Filter: 101
(9 rows)
@@ -12120,12 +12120,12 @@ DELETE FROM async_p2;
DELETE FROM async_p3;
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
SELECT * FROM async_pt;
- QUERY PLAN
--------------------------------------------------------------------------
- Append (actual rows=0 loops=1)
- -> Async Foreign Scan on async_p1 async_pt_1 (actual rows=0 loops=1)
- -> Async Foreign Scan on async_p2 async_pt_2 (actual rows=0 loops=1)
- -> Seq Scan on async_p3 async_pt_3 (actual rows=0 loops=1)
+ QUERY PLAN
+----------------------------------------------------------------------------
+ Append (actual rows=0.00 loops=1)
+ -> Async Foreign Scan on async_p1 async_pt_1 (actual rows=0.00 loops=1)
+ -> Async Foreign Scan on async_p2 async_pt_2 (actual rows=0.00 loops=1)
+ -> Seq Scan on async_p3 async_pt_3 (actual rows=0.00 loops=1)
(4 rows)
-- Clean up