From 3076d36986e68aa8acef7731edd0fb207c414b2f Mon Sep 17 00:00:00 2001 From: Anthonin Bonnefoy Date: Tue, 23 Apr 2024 11:22:18 +0200 Subject: [PATCH] Fix test for subplan end --- expected/planstate_subplans.out | 10 ++++++---- sql/planstate_subplans.sql | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/expected/planstate_subplans.out b/expected/planstate_subplans.out index e1bee53..399a483 100644 --- a/expected/planstate_subplans.out +++ b/expected/planstate_subplans.out @@ -139,13 +139,15 @@ SELECT span_id AS span_g_id, get_epoch(span_end) as span_g_end from pg_tracing_peek_spans where parent_id =:'span_f_id' and span_operation='Result' \gset -SELECT :span_a_end >= :span_c_end as merge_ends_after_subplan, +-- Subplans are stopped by the shutdown node walker after the main node. +-- Therefore, subplan can appear as finishing after its parent +SELECT :span_a_end <= :span_c_end as merge_ends_before_subplan, :span_c_end >= :span_d_start as bitmap_or_third_child_start_after_second, :span_e_start <= :span_f_start as cte_scan_starts_before_cte_basic, :span_f_start >= :span_e_start as cte_basic_starts_after_cte_scan; - merge_ends_after_subplan | bitmap_or_third_child_start_after_second | cte_scan_starts_before_cte_basic | cte_basic_starts_after_cte_scan ---------------------------+------------------------------------------+----------------------------------+--------------------------------- - t | t | t | t + merge_ends_before_subplan | bitmap_or_third_child_start_after_second | cte_scan_starts_before_cte_basic | cte_basic_starts_after_cte_scan +---------------------------+------------------------------------------+----------------------------------+--------------------------------- + t | t | t | t (1 row) -- Check deparse information for subplan diff --git a/sql/planstate_subplans.sql b/sql/planstate_subplans.sql index 834fdb4..26ae85d 100644 --- a/sql/planstate_subplans.sql +++ b/sql/planstate_subplans.sql @@ -130,7 +130,9 @@ SELECT span_id AS span_g_id, from pg_tracing_peek_spans where parent_id =:'span_f_id' and span_operation='Result' \gset -SELECT :span_a_end >= :span_c_end as merge_ends_after_subplan, +-- Subplans are stopped by the shutdown node walker after the main node. +-- Therefore, subplan can appear as finishing after its parent +SELECT :span_a_end <= :span_c_end as merge_ends_before_subplan, :span_c_end >= :span_d_start as bitmap_or_third_child_start_after_second, :span_e_start <= :span_f_start as cte_scan_starts_before_cte_basic, :span_f_start >= :span_e_start as cte_basic_starts_after_cte_scan;