Commit af73a4f
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):
- `RowsToReturnEstimated`: the estimated number of rows to be returned
by the query
- `RowsToFetchEstimated`: the estimated number of rows the query
is going to fetch from storage
- `KeysToIterateEstimated`: the estimated number of primary keys to
read from the indexes when executing the query to completion
- `CostEstimated`: the abstract cost of query execution
- `LogSelectivityEstimated`: minus decimal logarithm of query
selectivity, before applying the query LIMIT (0 means the query
selects all rows, 5 means it selects 10^(-5) = 0.00001 subset
of rows)
- `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:
- `TotalRowsToReturnEstimated`: the sum of all estimates of returned
rows from all completed queries
- `TotalRowsToFetchEstimated`: the sum of all estimates of fetched
rows from all completed queries
- `TotalKeysToIterateEstimated`: the sum of all estimates of iterated
primary keys from all completed queries
- `TotalCostEstimated`: counts the sum of all cost estimates from
all completed queries
# Conflicts:
# src/java/org/apache/cassandra/index/sai/QueryContext.java1 parent 1200c45 commit af73a4f
File tree
9 files changed
+497
-64
lines changed- src/java/org/apache/cassandra
- config
- index/sai
- metrics
- plan
- test/unit/org/apache/cassandra/index/sai
- metrics
- plan
9 files changed
+497
-64
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
641 | 648 | | |
642 | 649 | | |
643 | 650 | | |
| |||
Lines changed: 43 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | 224 | | |
229 | 225 | | |
230 | 226 | | |
| |||
250 | 246 | | |
251 | 247 | | |
252 | 248 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 249 | + | |
258 | 250 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 251 | + | |
| 252 | + | |
264 | 253 | | |
265 | 254 | | |
266 | 255 | | |
| |||
311 | 300 | | |
312 | 301 | | |
313 | 302 | | |
314 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
315 | 306 | | |
316 | 307 | | |
317 | 308 | | |
| |||
339 | 330 | | |
340 | 331 | | |
341 | 332 | | |
342 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
343 | 365 | | |
344 | 366 | | |
345 | 367 | | |
Lines changed: 120 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
118 | | - | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| |||
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | | - | |
203 | | - | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
224 | | - | |
225 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
226 | 228 | | |
227 | 229 | | |
228 | 230 | | |
| |||
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
250 | 284 | | |
251 | 285 | | |
252 | 286 | | |
| |||
293 | 327 | | |
294 | 328 | | |
295 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
296 | 333 | | |
297 | 334 | | |
298 | 335 | | |
| |||
323 | 360 | | |
324 | 361 | | |
325 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
326 | 367 | | |
327 | 368 | | |
328 | 369 | | |
| |||
362 | 403 | | |
363 | 404 | | |
364 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
365 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
366 | 474 | | |
| 475 | + | |
| 476 | + | |
367 | 477 | | |
0 commit comments