-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
415 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,35 @@ | ||
/*dddbs='postgres.db',traceparent='00-00000000000000000000000000000001-0000000000000001-01'*/ SELECT * from pg_tracing_test where a=1 OR a=2 OR a=3; | ||
a | b | ||
---+---------------------- | ||
1 | aaa | ||
2 | aaa | ||
3 | aaa | ||
/*traceparent='00-00000000000000000000000000000001-0000000000000001-01'*/ SELECT * from pg_tracing_test where a=1 OR b='2' OR c=3; | ||
a | b | c | ||
---+----------------------+--- | ||
1 | 1 | 1 | ||
2 | 2 | 2 | ||
3 | 3 | 3 | ||
(3 rows) | ||
|
||
SELECT span_operation, deparse_info, parameters, lvl from peek_ordered_spans where trace_id='00000000000000000000000000000001'; | ||
span_operation | deparse_info | parameters | lvl | ||
----------------------------------------------------------+-----------------------------------------------+------------+----- | ||
SELECT * from pg_tracing_test where a=$1 OR a=$2 OR a=$3 | | {1,2,3} | 0 | ||
Planner | | | 1 | ||
ExecutorRun | | | 1 | ||
BitmapHeapScan on pg_tracing_test | Recheck Cond: ((a = 1) OR (a = 2) OR (a = 3)) | | 2 | ||
BitmapOr | | | 3 | ||
BitmapIndexScan on pg_tracing_index | Index Cond: (a = 1) | | 4 | ||
BitmapIndexScan on pg_tracing_index | Index Cond: (a = 2) | | 4 | ||
BitmapIndexScan on pg_tracing_index | Index Cond: (a = 3) | | 4 | ||
-- PG < 18 | ||
-- +-----------------------------------------------------------------------------------------+ | ||
-- | A: BitmapOr | | ||
-- ++-----------------------------+-------------------------------+--------------------------+ | ||
-- |B: Bitmap Index Scan (a=1) |C: Bitmap Index Scan (b='2') |D: Bitmap Index Scan (c=3)| | ||
-- +-----------------------------+-------------------------------+--------------------------+ | ||
-- PG >= 18 | ||
-- +-----------------------------------------------------------------------------------------+ | ||
-- | A: BitmapOr | | ||
-- ++-----------------------------+-------------------------------+--------------------------+ | ||
-- |B: Bitmap Index Scan (c=1) |C: Bitmap Index Scan (b='2') |D: Bitmap Index Scan (a=1)| | ||
-- +-----------------------------+-------------------------------+--------------------------+ | ||
SELECT span_operation, deparse_info, parameters, pos_start, pos_end, lvl from peek_ordered_spans_with_pos where trace_id='00000000000000000000000000000001'; | ||
span_operation | deparse_info | parameters | pos_start | pos_end | lvl | ||
----------------------------------------------------------+---------------------------------------------------------+------------+-----------+---------+----- | ||
SELECT * from pg_tracing_test where a=$1 OR b=$2 OR c=$3 | | {1,'2',3} | 1 | 11 | 0 | ||
Planner | | | 2 | 3 | 1 | ||
ExecutorRun | | | 4 | 10 | 1 | ||
BitmapHeapScan on pg_tracing_test | Recheck Cond: ((a = 1) OR (b = '2'::bpchar) OR (c = 3)) | | 5 | 9 | 2 | ||
BitmapOr | | | 5 | 8 | 3 | ||
BitmapIndexScan on pg_tracing_index_a | Index Cond: (a = 1) | | 5 | 6 | 4 | ||
BitmapIndexScan on pg_tracing_index_b | Index Cond: (b = '2'::bpchar) | | 6 | 7 | 4 | ||
BitmapIndexScan on pg_tracing_index_c | Index Cond: (c = 3) | | 7 | 8 | 4 | ||
(8 rows) | ||
|
||
-- | ||
-- +----------------------------------------------------------------------------------------------+ | ||
-- | A: BitmapOr | | ||
-- ++-----------------------------+-------------------------------+-------------------------------+ | ||
-- |B: Bitmap Index Scan (aid=1) |C: Bitmap Index Scan (aid=2) |D: Bitmap Index Scan (aid=3) | | ||
-- +-----------------------------+-------------------------------+-------------------------------+ | ||
SELECT span_id AS span_a_id, | ||
get_epoch(span_start) as span_a_start, | ||
get_epoch(span_end) as span_a_end | ||
from pg_tracing_peek_spans | ||
where trace_id='00000000000000000000000000000001' AND span_operation='BitmapOr' \gset | ||
SELECT span_id AS span_b_id, | ||
get_epoch(span_start) as span_b_start, | ||
get_epoch(span_end) as span_b_end | ||
from pg_tracing_peek_spans | ||
where parent_id =:'span_a_id' and deparse_info='Index Cond: (a = 1)' \gset | ||
SELECT span_id AS span_c_id, | ||
get_epoch(span_start) as span_c_start, | ||
get_epoch(span_end) as span_c_end | ||
from pg_tracing_peek_spans | ||
where parent_id =:'span_a_id' and deparse_info='Index Cond: (a = 2)' \gset | ||
SELECT span_id AS span_d_id, | ||
get_epoch(span_start) as span_d_start, | ||
get_epoch(span_end) as span_d_end | ||
from pg_tracing_peek_spans | ||
where parent_id =:'span_a_id' and deparse_info='Index Cond: (a = 3)' \gset | ||
SELECT :span_b_end >= :span_c_start as bitmap_or_second_child_start_after_first, | ||
:span_c_end >= :span_d_start as bitmap_or_third_child_start_after_second, | ||
:span_d_end <= :span_a_end as bitmap_or_ends_after_latest_child; | ||
bitmap_or_second_child_start_after_first | bitmap_or_third_child_start_after_second | bitmap_or_ends_after_latest_child | ||
------------------------------------------+------------------------------------------+----------------------------------- | ||
t | t | t | ||
(1 row) | ||
|
||
-- Clean created spans | ||
CALL clean_spans(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.