Support for additional NR metrics
[ric-app/mc.git] / mc-core / mc / queries / rrcx_pdf_cell.gsql
1 DEFINE{ query_name 'rrcx_pdf_neigh_gnb_csi'; 
2         max_lfta_disorder '1'; max_hfta_disorder '1';
3         comment 'distribution of the beam csi rsrp of neighboring cells, aggregated by gNB, computed from rrc transfer';
4 }
5
6 PARAM{ window uint;}
7 //      rsrp, rsrq, sinr ranges are 0 .. 127
8 //      for now divide into 5 bins.
9
10 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
11         gnb_id as GNB_ID,
12         count(*) as cnt,
13         sum( GEQ(rsrp, 0) & LEQ(rsrp,37) ) as rsrp_vbad,
14         sum( GEQ(rsrp,38) & LEQ(rsrp,52) ) as rsrp_bad,
15         sum( GEQ(rsrp,52) & LEQ(rsrp,67) ) as rsrp_medium,
16         sum( GEQ(rsrp,68) & LEQ(rsrp,82) ) as rsrp_good,
17         sum( GEQ(rsrp,83) & LEQ(rsrp,127) ) as rsrp_vgood
18 from RRCXFER.neighbor_beam_csi
19 group by timestamp_ms/$window as tb, gnb_id
20 ;
21
22
23 DEFINE{ query_name 'rrcx_pdf_serv_beam_cell'; 
24         max_lfta_disorder '1'; max_hfta_disorder '1';
25         comment 'distribution of the beam ssb rsrp of serving cells, aggregated by gnb_id / cell id, computed from rrc transfer';
26 }
27 PARAM{ window uint;}
28 //      rsrp, rsrq, sinr ranges are 0 .. 127
29 //      for now divide into 5 bins.
30
31 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
32         physCellId as CELL_ID, gnb_id as GNB_ID,
33         count(*) as cnt,
34         sum( GEQ(rsrp, 0) & LEQ(rsrp,37) ) as rsrp_vbad,
35         sum( GEQ(rsrp,38) & LEQ(rsrp,52) ) as rsrp_bad,
36         sum( GEQ(rsrp,52) & LEQ(rsrp,67) ) as rsrp_medium,
37         sum( GEQ(rsrp,68) & LEQ(rsrp,82) ) as rsrp_good,
38         sum( GEQ(rsrp,83) & LEQ(rsrp,127) ) as rsrp_vgood
39 from RRCXFER.serv_cell_beam_ssb
40 group by timestamp_ms/$window as tb, physCellId, gnb_id
41 ;
42
43 DEFINE{ query_name 'rrcx_pdf_serv_beam_gnb'; 
44         max_lfta_disorder '1'; max_hfta_disorder '1';
45         comment 'distribution of the beam ssb rsrp of serving cells, aggregated by gnb_id, computed from rrc transfer';
46 }
47 PARAM{ window uint;}
48 //      rsrp, rsrq, sinr ranges are 0 .. 127
49 //      for now divide into 5 bins.
50
51 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
52         gnb_id as GNB_ID,
53         count(*) as cnt,
54         sum( GEQ(rsrp, 0) & LEQ(rsrp,37) ) as rsrp_vbad,
55         sum( GEQ(rsrp,38) & LEQ(rsrp,52) ) as rsrp_bad,
56         sum( GEQ(rsrp,52) & LEQ(rsrp,67) ) as rsrp_medium,
57         sum( GEQ(rsrp,68) & LEQ(rsrp,82) ) as rsrp_good,
58         sum( GEQ(rsrp,83) & LEQ(rsrp,127) ) as rsrp_vgood
59 from RRCXFER.serv_cell_beam_ssb
60 group by timestamp_ms/$window as tb, gnb_id
61 ;
62
63 DEFINE{ query_name 'rrcx_pdf_serv_beam_menbue'; 
64         max_lfta_disorder '1'; max_hfta_disorder '1';
65         comment 'distribution of the  ssb beam rsrp of serving cells aggregated by menb ueid id, computed from rrc transfer';
66 }
67 PARAM{ window uint;}
68 //      rsrp, rsrq, sinr ranges are 0 .. 127
69 //      for now divide into 5 bins.
70 select tb, $window/1000.0 as measurementInterval,
71         gnb_id as GNB_ID, id_SgNB_UE_X2AP_ID,
72         count(*) as cnt,
73         sum( GEQ(rsrp, 0) & LEQ(rsrp,21) ) as rsrp_vbad,
74         sum( GEQ(rsrp,22) & LEQ(rsrp,36) ) as rsrp_bad,
75         sum( GEQ(rsrp,37) & LEQ(rsrp,51) ) as rsrp_medium,
76         sum( GEQ(rsrp,52) & LEQ(rsrp,66) ) as rsrp_good,
77         sum( GEQ(rsrp,67) & LEQ(rsrp,127) ) as rsrp_vgood
78 from RRCXFER.serv_cell_beam_ssb
79 group by timestamp_ms/$window as tb, gnb_id, id_SgNB_UE_X2AP_ID
80 ;
81
82 DEFINE{ query_name 'rrcx_pdf_serv_beam_join'; 
83         max_lfta_disorder '1'; max_hfta_disorder '1';
84         comment 'distribution of the  ssb beam rsrp of serving cells aggregated by menb ueid id, computed from rrc transfer';
85 }
86 PARAM{ window uint;}
87 Select r.tb, r.GNB_ID, m.gTP_TEID, r.cnt,
88         r.rsrp_vbad, r.rsrp_bad, r.rsrp_medium, r.rsrp_good, r.rsrp_vgood
89 LEFT_OUTER_JOIN from rrcx_pdf_serv_beam_menbue r, gnb_ueid_teid_map m
90 Where r.GNB_ID=m.GNB_ID and r.id_SgNB_UE_X2AP_ID=m.id_SgNB_UE_X2AP_ID and r.tb=m.TB
91 ;
92
93 DEFINE{ query_name 'rrcx_pdf_serv_beam_gtp_teid'; 
94         max_lfta_disorder '1'; max_hfta_disorder '1';
95         comment 'distribution of the  ssb beam rsrp of serving cells aggregated by ue (gtp_teid), computed from rrc transfer';
96 }
97 PARAM{ window uint;}
98 //      rsrp, rsrq, sinr ranges are 0 .. 127
99 //      for now divide into 5 bins.
100
101 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
102         GNB_ID, gTP_TEID,
103         sum(cnt) as cnt,
104         sum( rsrp_vbad ) as rsrp_vbad,
105         sum( rsrp_bad ) as rsrp_bad,
106         sum( rsrp_medium ) as rsrp_medium,
107         sum( rsrp_good ) as rsrp_good,
108         sum( rsrp_vgood ) as rsrp_vgood
109 from rrcx_pdf_serv_beam_join
110 group by tb, GNB_ID, gTP_TEID
111 ;
112
113
114
115 DEFINE{ query_name 'rrcx_pdf_neighbor_beam_cell'; 
116         max_lfta_disorder '1'; max_hfta_disorder '1';
117         comment 'distribution of the beam ssb rsrp of neighboring cells, aggregated by gnb_id / cell id, computed from rrc transfer';
118 }
119 PARAM{ window uint;}
120 //      rsrp, rsrq, sinr ranges are 0 .. 127
121 //      for now divide into 5 bins.
122
123 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
124         physCellId as CELL_ID, gnb_id as GNB_ID,
125         count(*) as cnt,
126         sum( GEQ(rsrp, 0) & LEQ(rsrp,37) ) as rsrp_vbad,
127         sum( GEQ(rsrp,38) & LEQ(rsrp,52) ) as rsrp_bad,
128         sum( GEQ(rsrp,52) & LEQ(rsrp,67) ) as rsrp_medium,
129         sum( GEQ(rsrp,68) & LEQ(rsrp,82) ) as rsrp_good,
130         sum( GEQ(rsrp,83) & LEQ(rsrp,127) ) as rsrp_vgood
131 from RRCXFER.neighbor_beam_ssb
132 group by timestamp_ms/$window as tb, physCellId, gnb_id
133 ;
134
135 DEFINE{ query_name 'rrcx_pdf_neighbor_beam_gnb'; 
136         max_lfta_disorder '1'; max_hfta_disorder '1';
137         comment 'distribution of the beam ssb rsrp of neighboring cells, aggregated by gNB, computed from rrc transfer';
138 }
139 PARAM{ window uint;}
140 //      rsrp, rsrq, sinr ranges are 0 .. 127
141 //      for now divide into 5 bins.
142
143 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
144         gnb_id as GNB_ID,
145         count(*) as cnt,
146         sum( GEQ(rsrp, 0) & LEQ(rsrp,37) ) as rsrp_vbad,
147         sum( GEQ(rsrp,38) & LEQ(rsrp,52) ) as rsrp_bad,
148         sum( GEQ(rsrp,52) & LEQ(rsrp,67) ) as rsrp_medium,
149         sum( GEQ(rsrp,68) & LEQ(rsrp,82) ) as rsrp_good,
150         sum( GEQ(rsrp,83) & LEQ(rsrp,127) ) as rsrp_vgood
151 from RRCXFER.neighbor_beam_ssb
152 group by timestamp_ms/$window as tb, gnb_id
153 ;
154
155 DEFINE{ query_name 'rrcx_pdf_neighbor_beam_menbue'; 
156         max_lfta_disorder '1'; max_hfta_disorder '1';
157         comment 'distribution of the beam ssb rsrp of neighboring cells aggregated by menb ueid id, computed from rrc transfer';
158 }
159 PARAM{ window uint;}
160 //      rsrp, rsrq, sinr ranges are 0 .. 127
161 //      for now divide into 5 bins.
162 select tb, $window/1000.0 as measurementInterval,
163         gnb_id as GNB_ID, id_SgNB_UE_X2AP_ID,
164         count(*) as cnt,
165         sum( GEQ(rsrp, 0) & LEQ(rsrp,21) ) as rsrp_vbad,
166         sum( GEQ(rsrp,22) & LEQ(rsrp,36) ) as rsrp_bad,
167         sum( GEQ(rsrp,37) & LEQ(rsrp,51) ) as rsrp_medium,
168         sum( GEQ(rsrp,52) & LEQ(rsrp,66) ) as rsrp_good,
169         sum( GEQ(rsrp,67) & LEQ(rsrp,127) ) as rsrp_vgood
170 from RRCXFER.neighbor_beam_ssb
171 group by timestamp_ms/$window as tb, gnb_id, id_SgNB_UE_X2AP_ID
172 ;
173
174 DEFINE{ query_name 'rrcx_pdf_neighbor_beam_join'; 
175         max_lfta_disorder '1'; max_hfta_disorder '1';
176         comment 'distribution of the beam ssb rsrp of neighboring cells aggregated by menb ueid id, computed from rrc transfer';
177 }
178 PARAM{ window uint;}
179 Select r.tb, r.GNB_ID, m.gTP_TEID, r.cnt,
180         r.rsrp_vbad, r.rsrp_bad, r.rsrp_medium, r.rsrp_good, r.rsrp_vgood
181 LEFT_OUTER_JOIN from rrcx_pdf_neighbor_beam_menbue r, gnb_ueid_teid_map m
182 Where r.GNB_ID=m.GNB_ID and r.id_SgNB_UE_X2AP_ID=m.id_SgNB_UE_X2AP_ID and r.tb=m.TB
183 ;
184
185 DEFINE{ query_name 'rrcx_pdf_neighbor_beam_gtp_teid'; 
186         max_lfta_disorder '1'; max_hfta_disorder '1';
187         comment 'distribution of the beam ssb rsrp of neighboring cells aggregated by ue (gtp_teid), computed from rrc transfer';
188 }
189 PARAM{ window uint;}
190 //      rsrp, rsrq, sinr ranges are 0 .. 127
191 //      for now divide into 5 bins.
192
193 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
194         GNB_ID, gTP_TEID,
195         sum(cnt) as cnt,
196         sum( rsrp_vbad ) as rsrp_vbad,
197         sum( rsrp_bad ) as rsrp_bad,
198         sum( rsrp_medium ) as rsrp_medium,
199         sum( rsrp_good ) as rsrp_good,
200         sum( rsrp_vgood ) as rsrp_vgood
201 from rrcx_pdf_neighbor_beam_join
202 group by tb, GNB_ID, gTP_TEID
203 ;
204
205
206
207
208
209
210
211 DEFINE{ query_name 'rrcx_pdf_serv_cell'; 
212         max_lfta_disorder '1'; max_hfta_disorder '1';
213         comment 'distribution of the  ssb rsrp of serving cell aggregated by cell id, computed from rrc transfer';
214 }
215 PARAM{ window uint;}
216 //      rsrp, rsrq, sinr ranges are 0 .. 127
217 //      for now divide into 5 bins.
218
219 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
220         physCellId as CELL_ID, gnb_id as GNB_ID,
221         count(*) as cnt,
222         sum( GEQ(rsrp, 0) & LEQ(rsrp,21) ) as rsrp_vbad,
223         sum( GEQ(rsrp,22) & LEQ(rsrp,36) ) as rsrp_bad,
224         sum( GEQ(rsrp,37) & LEQ(rsrp,51) ) as rsrp_medium,
225         sum( GEQ(rsrp,52) & LEQ(rsrp,66) ) as rsrp_good,
226         sum( GEQ(rsrp,67) & LEQ(rsrp,127) ) as rsrp_vgood
227 from RRCXFER.serv_nr_cell
228 group by timestamp_ms/$window as tb, physCellId, gnb_id
229 ;
230
231 DEFINE{ query_name 'rrcx_pdf_neighbor_cell'; 
232         max_lfta_disorder '1'; max_hfta_disorder '1';
233         comment 'distribution of the  ssb rsrp of the neighboring cells by cell id, computed from rrc transfer';
234 }
235 PARAM{ window uint;}
236 //      rsrp, rsrq, sinr ranges are 0 .. 127
237 //      for now divide into 5 bins.
238
239 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
240         physCellId as CELL_ID, gnb_id as GNB_ID,
241         count(*) as cnt,
242         sum( GEQ(rsrp, 0) & LEQ(rsrp,21) ) as rsrp_vbad,
243         sum( GEQ(rsrp,22) & LEQ(rsrp,36) ) as rsrp_bad,
244         sum( GEQ(rsrp,37) & LEQ(rsrp,51) ) as rsrp_medium,
245         sum( GEQ(rsrp,52) & LEQ(rsrp,66) ) as rsrp_good,
246         sum( GEQ(rsrp,67) & LEQ(rsrp,127) ) as rsrp_vgood
247 from RRCXFER.nr_neighbor
248 group by timestamp_ms/$window as tb, physCellId, gnb_id
249 ;
250
251
252 DEFINE{ query_name 'rrcx_pdf_serv_gnb'; 
253         max_lfta_disorder '1'; max_hfta_disorder '1';
254         comment 'distribution of the  ssb rsrp of serving cells aggregated by gnb id, computed from rrc transfer';
255 }
256 PARAM{ window uint;}
257 //      rsrp, rsrq, sinr ranges are 0 .. 127
258 //      for now divide into 5 bins.
259
260 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
261         gnb_id as GNB_ID,
262         count(*) as cnt,
263         sum( GEQ(rsrp, 0) & LEQ(rsrp,21) ) as rsrp_vbad,
264         sum( GEQ(rsrp,22) & LEQ(rsrp,36) ) as rsrp_bad,
265         sum( GEQ(rsrp,37) & LEQ(rsrp,51) ) as rsrp_medium,
266         sum( GEQ(rsrp,52) & LEQ(rsrp,66) ) as rsrp_good,
267         sum( GEQ(rsrp,67) & LEQ(rsrp,127) ) as rsrp_vgood
268 from RRCXFER.serv_nr_cell
269 group by timestamp_ms/$window as tb, gnb_id
270 ;
271
272 DEFINE{ query_name 'rrcx_pdf_serv_menbue'; 
273         max_lfta_disorder '1'; max_hfta_disorder '1';
274         comment 'distribution of the  ssb rsrp of serving cells aggregated by menb ueid id, computed from rrc transfer';
275 }
276 PARAM{ window uint;}
277 //      rsrp, rsrq, sinr ranges are 0 .. 127
278 //      for now divide into 5 bins.
279 select tb, $window/1000.0 as measurementInterval,
280         gnb_id as GNB_ID, id_SgNB_UE_X2AP_ID,
281         count(*) as cnt,
282         sum( GEQ(rsrp, 0) & LEQ(rsrp,21) ) as rsrp_vbad,
283         sum( GEQ(rsrp,22) & LEQ(rsrp,36) ) as rsrp_bad,
284         sum( GEQ(rsrp,37) & LEQ(rsrp,51) ) as rsrp_medium,
285         sum( GEQ(rsrp,52) & LEQ(rsrp,66) ) as rsrp_good,
286         sum( GEQ(rsrp,67) & LEQ(rsrp,127) ) as rsrp_vgood
287 from RRCXFER.serv_nr_cell
288 group by timestamp_ms/$window as tb, gnb_id, id_SgNB_UE_X2AP_ID
289 ;
290
291 DEFINE{ query_name 'rrcx_pdf_serv_join'; 
292         max_lfta_disorder '1'; max_hfta_disorder '1';
293         comment 'distribution of the  ssb rsrp of serving cells aggregated by menb ueid id, computed from rrc transfer';
294 }
295 PARAM{ window uint;}
296 Select r.tb, r.GNB_ID, m.gTP_TEID, r.cnt,
297         r.rsrp_vbad, r.rsrp_bad, r.rsrp_medium, r.rsrp_good, r.rsrp_vgood
298 LEFT_OUTER_JOIN from rrcx_pdf_serv_menbue r, gnb_ueid_teid_map m
299 Where r.GNB_ID=m.GNB_ID and r.id_SgNB_UE_X2AP_ID=m.id_SgNB_UE_X2AP_ID and r.tb=m.TB
300 ;
301
302 DEFINE{ query_name 'rrcx_pdf_serv_gtp_teid'; 
303         max_lfta_disorder '1'; max_hfta_disorder '1';
304         comment 'distribution of the  ssb rsrp of serving cells aggregated by ue (gtp_teid), computed from rrc transfer';
305 }
306 PARAM{ window uint;}
307 //      rsrp, rsrq, sinr ranges are 0 .. 127
308 //      for now divide into 5 bins.
309
310 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
311         GNB_ID, gTP_TEID,
312         sum(cnt) as cnt,
313         sum( rsrp_vbad ) as rsrp_vbad,
314         sum( rsrp_bad ) as rsrp_bad,
315         sum( rsrp_medium ) as rsrp_medium,
316         sum( rsrp_good ) as rsrp_good,
317         sum( rsrp_vgood ) as rsrp_vgood
318 from rrcx_pdf_serv_join
319 group by tb, GNB_ID, gTP_TEID
320 ;
321
322
323 DEFINE{ query_name 'rrcx_pdf_neighbor_gnb'; 
324         max_lfta_disorder '1'; max_hfta_disorder '1';
325         comment 'distribution of the  ssb rsrp of neighbor cells aggregated by gNB, computed from rrc transfer';
326 }
327 PARAM{ window uint;}
328 //      rsrp, rsrq, sinr ranges are 0 .. 127
329 //      for now divide into 5 bins.
330
331 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
332         gnb_id as GNB_ID,
333         count(*) as cnt,
334         sum( GEQ(rsrp, 0) & LEQ(rsrp,21) ) as rsrp_vbad,
335         sum( GEQ(rsrp,22) & LEQ(rsrp,36) ) as rsrp_bad,
336         sum( GEQ(rsrp,37) & LEQ(rsrp,51) ) as rsrp_medium,
337         sum( GEQ(rsrp,52) & LEQ(rsrp,66) ) as rsrp_good,
338         sum( GEQ(rsrp,67) & LEQ(rsrp,127) ) as rsrp_vgood
339 from RRCXFER.nr_neighbor
340 group by timestamp_ms/$window as tb, gnb_id
341 ;
342
343 DEFINE{ query_name 'rrcx_pdf_neighbor_menbue'; 
344         max_lfta_disorder '1'; max_hfta_disorder '1';
345         comment 'distribution of the  ssb rsrp of neighbor cells aggregated by menb ueid id, computed from rrc transfer';
346 }
347 PARAM{ window uint;}
348 //      rsrp, rsrq, sinr ranges are 0 .. 127
349 //      for now divide into 5 bins.
350 select tb, $window/1000.0 as measurementInterval,
351         gnb_id as GNB_ID, id_SgNB_UE_X2AP_ID,
352         count(*) as cnt,
353         sum( GEQ(rsrp, 0) & LEQ(rsrp,21) ) as rsrp_vbad,
354         sum( GEQ(rsrp,22) & LEQ(rsrp,36) ) as rsrp_bad,
355         sum( GEQ(rsrp,37) & LEQ(rsrp,51) ) as rsrp_medium,
356         sum( GEQ(rsrp,52) & LEQ(rsrp,66) ) as rsrp_good,
357         sum( GEQ(rsrp,67) & LEQ(rsrp,127) ) as rsrp_vgood
358 from RRCXFER.nr_neighbor
359 group by timestamp_ms/$window as tb, gnb_id, id_SgNB_UE_X2AP_ID
360 ;
361
362 DEFINE{ query_name 'rrcx_pdf_neighbor_join'; 
363         max_lfta_disorder '1'; max_hfta_disorder '1';
364         comment 'distribution of the  ssb rsrp of neighbor cells aggregated by menb ueid id, computed from rrc transfer';
365 }
366 PARAM{ window uint;}
367 Select r.tb, r.GNB_ID, m.gTP_TEID, r.cnt,
368         r.rsrp_vbad, r.rsrp_bad, r.rsrp_medium, r.rsrp_good, r.rsrp_vgood
369 LEFT_OUTER_JOIN from rrcx_pdf_neighbor_menbue r, gnb_ueid_teid_map m
370 Where r.GNB_ID=m.GNB_ID and r.id_SgNB_UE_X2AP_ID=m.id_SgNB_UE_X2AP_ID and r.tb=m.TB
371 ;
372
373 DEFINE{ query_name 'rrcx_pdf_neighbor_gtp_teid'; 
374         max_lfta_disorder '1'; max_hfta_disorder '1';
375         comment 'distribution of the  ssb rsrp of neighbor cells aggregated by ue (gtp_teid), computed from rrc transfer';
376 }
377 PARAM{ window uint;}
378 //      rsrp, rsrq, sinr ranges are 0 .. 127
379 //      for now divide into 5 bins.
380
381 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
382         GNB_ID, gTP_TEID,
383         sum(cnt) as cnt,
384         sum( rsrp_vbad ) as rsrp_vbad,
385         sum( rsrp_bad ) as rsrp_bad,
386         sum( rsrp_medium ) as rsrp_medium,
387         sum( rsrp_good ) as rsrp_good,
388         sum( rsrp_vgood ) as rsrp_vgood
389 from rrcx_pdf_neighbor_join
390 group by tb, GNB_ID, gTP_TEID
391
392