Skip to content

Commit

Permalink
Fix test for subplan end
Browse files Browse the repository at this point in the history
  • Loading branch information
bonnefoa committed Apr 23, 2024
1 parent 355557d commit 3076d36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions expected/planstate_subplans.out
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion sql/planstate_subplans.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3076d36

Please sign in to comment.