|
1 | | -SELECT DISTINCT |
2 | | - s.trace_id, |
| 1 | +SELECT |
| 2 | + l.trace_id, |
3 | 3 | t.start, |
4 | 4 | t.end |
5 | | -FROM spans s |
6 | | -LEFT JOIN trace_id_timestamps t ON s.trace_id = t.trace_id |
7 | | -WHERE 1=1 |
8 | | - AND s.service_name = ? |
9 | | - AND s.name = ? |
10 | | - AND s.duration >= ? |
11 | | - AND s.duration <= ? |
12 | | - AND s.start_time >= ? |
13 | | - AND s.start_time <= ? |
14 | | - AND ( |
15 | | - arrayExists((key, value) -> key = ? AND value = ?, s.bool_attributes.key, s.bool_attributes.value) |
16 | | - OR |
17 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_bool_attributes.key, s.resource_bool_attributes.value) |
18 | | - OR |
19 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.bool_attributes.key, x.bool_attributes.value), s.events) |
20 | | - OR |
21 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.bool_attributes.key, x.bool_attributes.value), s.links) |
22 | | - ) |
23 | | - AND ( |
24 | | - arrayExists((key, value) -> key = ? AND value = ?, s.double_attributes.key, s.double_attributes.value) |
25 | | - OR |
26 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_double_attributes.key, s.resource_double_attributes.value) |
27 | | - OR |
28 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.double_attributes.key, x.double_attributes.value), s.events) |
29 | | - OR |
30 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.double_attributes.key, x.double_attributes.value), s.links) |
31 | | - ) |
32 | | - AND ( |
33 | | - arrayExists((key, value) -> key = ? AND value = ?, s.int_attributes.key, s.int_attributes.value) |
34 | | - OR |
35 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_int_attributes.key, s.resource_int_attributes.value) |
36 | | - OR |
37 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.int_attributes.key, x.int_attributes.value), s.events) |
38 | | - OR |
39 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.int_attributes.key, x.int_attributes.value), s.links) |
40 | | - ) |
41 | | - AND ( |
42 | | - arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
43 | | - OR |
44 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_complex_attributes.key, s.resource_complex_attributes.value) |
45 | | - OR |
46 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.events) |
47 | | - OR |
48 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.links) |
49 | | - ) |
50 | | - AND ( |
51 | | - arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
52 | | - OR |
53 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_complex_attributes.key, s.resource_complex_attributes.value) |
54 | | - OR |
55 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.events) |
56 | | - OR |
57 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.links) |
58 | | - ) |
59 | | - AND ( |
60 | | - arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
61 | | - OR |
62 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_complex_attributes.key, s.resource_complex_attributes.value) |
63 | | - OR |
64 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.events) |
65 | | - OR |
66 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.links) |
67 | | - ) |
68 | | - AND ( |
69 | | - arrayExists((key, value) -> key = ? AND value = ?, s.str_attributes.key, s.str_attributes.value) |
70 | | - OR |
71 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_str_attributes.key, s.resource_str_attributes.value) |
72 | | - OR |
73 | | - arrayExists((key, value) -> key = ? AND value = ?, s.scope_str_attributes.key, s.scope_str_attributes.value) |
74 | | - OR |
75 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.str_attributes.key, x.str_attributes.value), s.events) |
76 | | - OR |
77 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.str_attributes.key, x.str_attributes.value), s.links) |
78 | | - ) |
79 | | - AND ( |
80 | | - arrayExists((key, value) -> key = ? AND value = ?, s.str_attributes.key, s.str_attributes.value) |
81 | | - ) |
82 | | - AND ( |
83 | | - arrayExists((key, value) -> key = ? AND value = ?, s.bool_attributes.key, s.bool_attributes.value) |
84 | | - ) |
85 | | - AND ( |
86 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_double_attributes.key, s.resource_double_attributes.value) |
87 | | - ) |
88 | | - AND ( |
89 | | - arrayExists((key, value) -> key = ? AND value = ?, s.scope_int_attributes.key, s.scope_int_attributes.value) |
90 | | - ) |
91 | | - AND ( |
92 | | - arrayExists((key, value) -> key = ? AND value = ?, s.resource_complex_attributes.key, s.resource_complex_attributes.value) |
93 | | - ) |
94 | | - AND ( |
95 | | - arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
96 | | - ) |
97 | | - AND ( |
98 | | - arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
99 | | - ) |
100 | | - AND ( |
101 | | - arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.str_attributes.key, x.str_attributes.value), s.events) |
102 | | - ) |
103 | | -LIMIT ? |
| 5 | +FROM ( |
| 6 | + SELECT DISTINCT |
| 7 | + s.trace_id |
| 8 | + FROM spans s |
| 9 | + WHERE 1=1 |
| 10 | + AND s.service_name = ? |
| 11 | + AND s.name = ? |
| 12 | + AND s.duration >= ? |
| 13 | + AND s.duration <= ? |
| 14 | + AND s.start_time >= ? |
| 15 | + AND s.start_time <= ? |
| 16 | + AND ( |
| 17 | + arrayExists((key, value) -> key = ? AND value = ?, s.bool_attributes.key, s.bool_attributes.value) |
| 18 | + OR |
| 19 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_bool_attributes.key, s.resource_bool_attributes.value) |
| 20 | + OR |
| 21 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.bool_attributes.key, x.bool_attributes.value), s.events) |
| 22 | + OR |
| 23 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.bool_attributes.key, x.bool_attributes.value), s.links) |
| 24 | + ) |
| 25 | + AND ( |
| 26 | + arrayExists((key, value) -> key = ? AND value = ?, s.double_attributes.key, s.double_attributes.value) |
| 27 | + OR |
| 28 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_double_attributes.key, s.resource_double_attributes.value) |
| 29 | + OR |
| 30 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.double_attributes.key, x.double_attributes.value), s.events) |
| 31 | + OR |
| 32 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.double_attributes.key, x.double_attributes.value), s.links) |
| 33 | + ) |
| 34 | + AND ( |
| 35 | + arrayExists((key, value) -> key = ? AND value = ?, s.int_attributes.key, s.int_attributes.value) |
| 36 | + OR |
| 37 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_int_attributes.key, s.resource_int_attributes.value) |
| 38 | + OR |
| 39 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.int_attributes.key, x.int_attributes.value), s.events) |
| 40 | + OR |
| 41 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.int_attributes.key, x.int_attributes.value), s.links) |
| 42 | + ) |
| 43 | + AND ( |
| 44 | + arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
| 45 | + OR |
| 46 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_complex_attributes.key, s.resource_complex_attributes.value) |
| 47 | + OR |
| 48 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.events) |
| 49 | + OR |
| 50 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.links) |
| 51 | + ) |
| 52 | + AND ( |
| 53 | + arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
| 54 | + OR |
| 55 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_complex_attributes.key, s.resource_complex_attributes.value) |
| 56 | + OR |
| 57 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.events) |
| 58 | + OR |
| 59 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.links) |
| 60 | + ) |
| 61 | + AND ( |
| 62 | + arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
| 63 | + OR |
| 64 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_complex_attributes.key, s.resource_complex_attributes.value) |
| 65 | + OR |
| 66 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.events) |
| 67 | + OR |
| 68 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.complex_attributes.key, x.complex_attributes.value), s.links) |
| 69 | + ) |
| 70 | + AND ( |
| 71 | + arrayExists((key, value) -> key = ? AND value = ?, s.str_attributes.key, s.str_attributes.value) |
| 72 | + OR |
| 73 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_str_attributes.key, s.resource_str_attributes.value) |
| 74 | + OR |
| 75 | + arrayExists((key, value) -> key = ? AND value = ?, s.scope_str_attributes.key, s.scope_str_attributes.value) |
| 76 | + OR |
| 77 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.str_attributes.key, x.str_attributes.value), s.events) |
| 78 | + OR |
| 79 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.str_attributes.key, x.str_attributes.value), s.links) |
| 80 | + ) |
| 81 | + AND ( |
| 82 | + arrayExists((key, value) -> key = ? AND value = ?, s.str_attributes.key, s.str_attributes.value) |
| 83 | + ) |
| 84 | + AND ( |
| 85 | + arrayExists((key, value) -> key = ? AND value = ?, s.bool_attributes.key, s.bool_attributes.value) |
| 86 | + ) |
| 87 | + AND ( |
| 88 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_double_attributes.key, s.resource_double_attributes.value) |
| 89 | + ) |
| 90 | + AND ( |
| 91 | + arrayExists((key, value) -> key = ? AND value = ?, s.scope_int_attributes.key, s.scope_int_attributes.value) |
| 92 | + ) |
| 93 | + AND ( |
| 94 | + arrayExists((key, value) -> key = ? AND value = ?, s.resource_complex_attributes.key, s.resource_complex_attributes.value) |
| 95 | + ) |
| 96 | + AND ( |
| 97 | + arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
| 98 | + ) |
| 99 | + AND ( |
| 100 | + arrayExists((key, value) -> key = ? AND value = ?, s.complex_attributes.key, s.complex_attributes.value) |
| 101 | + ) |
| 102 | + AND ( |
| 103 | + arrayExists(x -> arrayExists((key, value) -> key = ? AND value = ?, x.str_attributes.key, x.str_attributes.value), s.events) |
| 104 | + ) |
| 105 | + LIMIT ? |
| 106 | +) l |
| 107 | +LEFT JOIN trace_id_timestamps t ON l.trace_id = t.trace_id |
0 commit comments