Commit 7986ec2
Piotr Kołaczkowski
CNDB-15508: Query planner metrics
This commit adds new metrics related to the operation of SAI query
planner. The metrics should help checking if the query planner makes
proper decisions by correlating them with the other metrics,
e.g. the metrics of the actual query execution.
Per-query metrics (histograms):
- `RowsEstimated`: the estimated number of rows to be returned by
the query
- `CostEstimated`: the abstract cost of query execution
- `InverseSelectivityEstimated`: the inverse of query selectivity,
before applying the query LIMIT
(1 means the query selects all rows, 10 means it
selects every 10th row, etc.)
- `IndexReferencesInQuery`: the number of index references in the
unoptimized query execution plan (the same index may
be referenced multiple times and counts separately)
- `IndexReferencesInPlan`: the number of index references in the
optimized query execution plan (the same index may
be referenced multiple times and counts separately)
Per-table:
- `TotalRowsEstimated`: counts the sum of all row estimates from
all completed queries
- `TotalCostEstimated`: counts the sum of all cost estimates from
all completed queries
- `TotalQueriesCompletedInSelectivityGroup{N}`, where N in [0, 12):
counts the number of completed queries with selectivity S:
10^(-N-1) < S <= 10^(-N) for N < 11,
S <= 10^(-N) for N = 11
In other words, the higher the group N, the smaller fraction of rows
the query is estimated to return. The selectivity calculation
does not include the final LIMIT of the query.1 parent 95724c0 commit 7986ec2
File tree
7 files changed
+281
-56
lines changed- src/java/org/apache/cassandra/index/sai
- metrics
- plan
- test/unit/org/apache/cassandra/index/sai
- metrics
- plan
7 files changed
+281
-56
lines changedLines changed: 40 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
| |||
208 | 205 | | |
209 | 206 | | |
210 | 207 | | |
211 | | - | |
| 208 | + | |
212 | 209 | | |
213 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 251 | + | |
254 | 252 | | |
255 | | - | |
256 | | - | |
| 253 | + | |
| 254 | + | |
257 | 255 | | |
258 | | - | |
259 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
| |||
290 | 289 | | |
291 | 290 | | |
292 | 291 | | |
293 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
294 | 304 | | |
295 | 305 | | |
296 | 306 | | |
| |||
315 | 325 | | |
316 | 326 | | |
317 | 327 | | |
318 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
319 | 336 | | |
320 | 337 | | |
| 338 | + | |
| 339 | + | |
321 | 340 | | |
Lines changed: 62 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
197 | 204 | | |
198 | 205 | | |
199 | 206 | | |
| |||
211 | 218 | | |
212 | 219 | | |
213 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
214 | 228 | | |
215 | 229 | | |
216 | 230 | | |
| |||
227 | 241 | | |
228 | 242 | | |
229 | 243 | | |
| 244 | + | |
| 245 | + | |
230 | 246 | | |
231 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
232 | 252 | | |
233 | | - | |
| 253 | + | |
234 | 254 | | |
235 | 255 | | |
236 | 256 | | |
| |||
276 | 296 | | |
277 | 297 | | |
278 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
279 | 325 | | |
280 | 326 | | |
281 | 327 | | |
| |||
304 | 350 | | |
305 | 351 | | |
306 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
307 | 359 | | |
308 | 360 | | |
309 | 361 | | |
| |||
340 | 392 | | |
341 | 393 | | |
342 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
343 | 402 | | |
344 | 403 | | |
345 | 404 | | |
0 commit comments