Adding MC-NIB support
[ric-app/mc.git] / mc-core / mc / queries / rrcx_pdf_cell.gsql
1
2 DEFINE{ query_name 'rrcx_pdf_neigh_cell_csi'; 
3         max_lfta_disorder '1'; max_hfta_disorder '1';
4         comment 'distribution of the beam csi rsrp of neighboring cells, aggregated by cell id, computed from rrc transfer';
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         physCellId as CELL_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 // where schemaId = 5
20 group by timestamp_ms/$window as tb, physCellId
21 ;
22
23 DEFINE{ query_name 'rrcx_pdf_neigh_gnb_csi'; 
24         max_lfta_disorder '1'; max_hfta_disorder '1';
25         comment 'distribution of the beam csi rsrp of neighboring cells, aggregated by gNB, 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         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.neighbor_beam_csi
40 // where schemaId = 5
41 group by timestamp_ms/$window as tb, gnb_id
42 ;
43
44
45 DEFINE{ query_name 'rrcx_pdf_neigh_cell_ssb'; 
46         max_lfta_disorder '1'; max_hfta_disorder '1';
47         comment 'distribution of the beam ssb rsrp of neighboring cells, aggregated by cell id, computed from rrc transfer';
48 }
49 PARAM{ window uint;}
50 //      rsrp, rsrq, sinr ranges are 0 .. 127
51 //      for now divide into 5 bins.
52
53 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
54         physCellId as CELL_ID,
55         count(*) as cnt,
56         sum(GEQ(rsrp, 0)*LEQ(rsrp,37)) as rsrp_vbad,
57         sum(GEQ(rsrp,38)*LEQ(rsrp,52)) as rsrp_bad,
58         sum(GEQ(rsrp,52)*LEQ(rsrp,67)) as rsrp_medium,
59         sum(GEQ(rsrp,68)*LEQ(rsrp,82)) as rsrp_good,
60         sum(GEQ(rsrp,83)*LEQ(rsrp,127)) as rsrp_vgood
61 from RRCXFER.neighbor_beam_ssb
62 // where schemaId = 6
63 group by timestamp_ms/$window as tb, physCellId
64 ;
65
66 DEFINE{ query_name 'rrcx_pdf_neigh_gnb_ssb'; 
67         max_lfta_disorder '1'; max_hfta_disorder '1';
68         comment 'distribution of the beam ssb rsrp of neighboring cells, aggregated by gNB, computed from rrc transfer';
69 }
70 PARAM{ window uint;}
71 //      rsrp, rsrq, sinr ranges are 0 .. 127
72 //      for now divide into 5 bins.
73
74 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
75         gnb_id as GNB_ID,
76         count(*) as cnt,
77         sum(GEQ(rsrp, 0)*LEQ(rsrp,37)) as rsrp_vbad,
78         sum(GEQ(rsrp,38)*LEQ(rsrp,52)) as rsrp_bad,
79         sum(GEQ(rsrp,52)*LEQ(rsrp,67)) as rsrp_medium,
80         sum(GEQ(rsrp,68)*LEQ(rsrp,82)) as rsrp_good,
81         sum(GEQ(rsrp,83)*LEQ(rsrp,127)) as rsrp_vgood
82 from RRCXFER.neighbor_beam_ssb
83 // where schemaId = 6
84 group by timestamp_ms/$window as tb, gnb_id
85 ;
86
87
88
89 DEFINE{ query_name 'rrcx_pdf_serv_cell'; 
90         max_lfta_disorder '1'; max_hfta_disorder '1';
91         comment 'distribution of the  ssb rsrp of serving cell aggregated by cell id, computed from rrc transfer';
92 }
93 PARAM{ window uint;}
94 //      rsrp, rsrq, sinr ranges are 0 .. 127
95 //      for now divide into 5 bins.
96
97 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
98         physCellId as CELL_ID,
99         count(*) as cnt,
100         sum(GEQ(rsrp, 0)*LEQ(rsrp,21)) as rsrp_vbad,
101         sum(GEQ(rsrp,22)*LEQ(rsrp,36)) as rsrp_bad,
102         sum(GEQ(rsrp,37)*LEQ(rsrp,51)) as rsrp_medium,
103         sum(GEQ(rsrp,52)*LEQ(rsrp,66)) as rsrp_good,
104         sum(GEQ(rsrp,67)*LEQ(rsrp,127)) as rsrp_vgood
105 from RRCXFER.serv_nr_cell
106 // where schemaId = 1
107 group by timestamp_ms/$window as tb, physCellId
108 ;
109
110 DEFINE{ query_name 'rrcx_pdf_neighbor_cell'; 
111         max_lfta_disorder '1'; max_hfta_disorder '1';
112 }
113 PARAM{ window uint;}
114 //      rsrp, rsrq, sinr ranges are 0 .. 127
115 //      for now divide into 5 bins.
116
117 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
118         physCellId as CELL_ID,
119         count(*) as cnt,
120         sum(GEQ(rsrp, 0)*LEQ(rsrp,21)) as rsrp_vbad,
121         sum(GEQ(rsrp,22)*LEQ(rsrp,36)) as rsrp_bad,
122         sum(GEQ(rsrp,37)*LEQ(rsrp,51)) as rsrp_medium,
123         sum(GEQ(rsrp,52)*LEQ(rsrp,66)) as rsrp_good,
124         sum(GEQ(rsrp,67)*LEQ(rsrp,127)) as rsrp_vgood
125 from RRCXFER.nr_neighbor
126 // where schemaId = 4
127 group by timestamp_ms/$window as tb, physCellId
128 ;
129
130
131 DEFINE{ query_name 'rrcx_pdf_serv_gnb'; 
132         max_lfta_disorder '1'; max_hfta_disorder '1';
133         comment 'distribution of the  ssb rsrp of neighbor cells aggregated by cell id, computed from rrc transfer';
134 }
135 PARAM{ window uint;}
136 //      rsrp, rsrq, sinr ranges are 0 .. 127
137 //      for now divide into 5 bins.
138
139 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
140         gnb_id as GNB_ID,
141         count(*) as cnt,
142         sum(GEQ(rsrp, 0)*LEQ(rsrp,21)) as rsrp_vbad,
143         sum(GEQ(rsrp,22)*LEQ(rsrp,36)) as rsrp_bad,
144         sum(GEQ(rsrp,37)*LEQ(rsrp,51)) as rsrp_medium,
145         sum(GEQ(rsrp,52)*LEQ(rsrp,66)) as rsrp_good,
146         sum(GEQ(rsrp,67)*LEQ(rsrp,127)) as rsrp_vgood
147 from RRCXFER.serv_nr_cell
148 // where schemaId = 1
149 group by timestamp_ms/$window as tb, gnb_id
150 ;
151
152 DEFINE{ query_name 'rrcx_pdf_neighbor_gnb'; 
153         max_lfta_disorder '1'; max_hfta_disorder '1';
154         comment 'distribution of the  ssb rsrp of neighbor cells aggregated by gNB, computed from rrc transfer';
155 }
156 PARAM{ window uint;}
157 //      rsrp, rsrq, sinr ranges are 0 .. 127
158 //      for now divide into 5 bins.
159
160 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
161         gnb_id as GNB_ID,
162         count(*) as cnt,
163         sum(GEQ(rsrp, 0)*LEQ(rsrp,21)) as rsrp_vbad,
164         sum(GEQ(rsrp,22)*LEQ(rsrp,36)) as rsrp_bad,
165         sum(GEQ(rsrp,37)*LEQ(rsrp,51)) as rsrp_medium,
166         sum(GEQ(rsrp,52)*LEQ(rsrp,66)) as rsrp_good,
167         sum(GEQ(rsrp,67)*LEQ(rsrp,127)) as rsrp_vgood
168 from RRCXFER.nr_neighbor
169 // where schemaId = 4
170 group by timestamp_ms/$window as tb, gnb_id
171
172