@@ -194,7 +194,9 @@ public static class PerTable extends AbstractQueryMetrics
194194 public final Counter totalRowsFiltered ;
195195 public final Counter totalQueriesCompleted ;
196196
197- public final Counter totalRowsEstimated ;
197+ public final Counter totalRowsToReturnEstimated ;
198+ public final Counter totalRowsToFetchEstimated ;
199+ public final Counter totalKeysToIterateEstimated ;
198200 public final Counter totalCostEstimated ;
199201
200202 public final Counter sortThenFilterQueriesCompleted ;
@@ -213,7 +215,9 @@ public PerTable(TableMetadata table, QueryKind queryKind, Predicate<ReadCommand>
213215 totalRowsFiltered = Metrics .counter (createMetricName ("TotalRowsFiltered" ));
214216 totalQueriesCompleted = Metrics .counter (createMetricName ("TotalQueriesCompleted" ));
215217 totalQueryTimeouts = Metrics .counter (createMetricName ("TotalQueryTimeouts" ));
216- totalRowsEstimated = Metrics .counter (createMetricName ("TotalRowsEstimated" ));
218+ totalRowsToReturnEstimated = Metrics .counter (createMetricName ("TotalRowsToReturnEstimated" ));
219+ totalRowsToFetchEstimated = Metrics .counter (createMetricName ("TotalRowsToFetchEstimated" ));
220+ totalKeysToIterateEstimated = Metrics .counter (createMetricName ("TotalKeysToIterateEstimated" ));
217221 totalCostEstimated = Metrics .counter (createMetricName ("TotalCostEstimated" ));
218222
219223 sortThenFilterQueriesCompleted = Metrics .counter (createMetricName ("SortThenFilterQueriesCompleted" ));
@@ -237,7 +241,9 @@ public void record(QueryContext.Snapshot snapshot)
237241 if (queryPlanInfo != null )
238242 {
239243 totalCostEstimated .inc (Math .round (queryPlanInfo .costEstimated ));
240- totalRowsEstimated .inc (Math .round (queryPlanInfo .rowsEstimated ));
244+ totalRowsToReturnEstimated .inc (Math .round (queryPlanInfo .rowsToReturnEstimated ));
245+ totalRowsToFetchEstimated .inc (Math .round (queryPlanInfo .rowsToFetchEstimated ));
246+ totalKeysToIterateEstimated .inc (Math .round (queryPlanInfo .keysToIterateEstimated ));
241247
242248 if (queryPlanInfo .filterExecutedAfterOrderedScan )
243249 sortThenFilterQueriesCompleted .inc ();
@@ -291,8 +297,14 @@ public static class PerQuery extends AbstractQueryMetrics
291297 /** Query execution cost as estimated by the planner */
292298 public final Histogram costEstimated ;
293299
294- /** Number of rows returned by the query estimated by the planner */
295- public final Histogram rowsEstimated ;
300+ /** Number of rows to be returned from the query as estimated by the planner */
301+ public final Histogram rowsToReturnEstimated ;
302+
303+ /** Number of rows to be fetched by the query as estimated by the planner */
304+ public final Histogram rowsToFetchEstimated ;
305+
306+ /** Number of rows to be fetched by the query as estimated by the planner */
307+ public final Histogram keysToIterateEstimated ;
296308
297309 /**
298310 * Negative deceimal logarithm of selectivity of the query, before applying the LIMIT clause.
@@ -340,7 +352,9 @@ public PerQuery(TableMetadata table, QueryKind queryKind, Predicate<ReadCommand>
340352 annGraphSearchLatency = Metrics .timer (createMetricName ("ANNGraphSearchLatency" ));
341353
342354 costEstimated = Metrics .histogram (createMetricName ("CostEstimated" ), false );
343- rowsEstimated = Metrics .histogram (createMetricName ("RowsEstimated" ), true );
355+ rowsToReturnEstimated = Metrics .histogram (createMetricName ("RowsToReturnEstimated" ), true );
356+ rowsToFetchEstimated = Metrics .histogram (createMetricName ("RowsToFetchEstimated" ), true );
357+ keysToIterateEstimated = Metrics .histogram (createMetricName ("KeysToIterateEstimated" ), true );
344358 logSelectivityEstimated = Metrics .histogram (createMetricName ("LogSelectivityEstimated" ), true );
345359 indexReferencesInPlan = Metrics .histogram (createMetricName ("IndexReferencesInPlan" ), true );
346360 indexReferencesInQuery = Metrics .histogram (createMetricName ("IndexReferencesInQuery" ), false );
@@ -385,7 +399,9 @@ public void record(QueryContext.Snapshot snapshot)
385399 if (queryPlanInfo != null )
386400 {
387401 costEstimated .update (Math .round (queryPlanInfo .costEstimated ));
388- rowsEstimated .update (Math .round (queryPlanInfo .rowsEstimated ));
402+ rowsToReturnEstimated .update (Math .round (queryPlanInfo .rowsToReturnEstimated ));
403+ rowsToFetchEstimated .update (Math .round (queryPlanInfo .rowsToFetchEstimated ));
404+ keysToIterateEstimated .update (Math .round (queryPlanInfo .keysToIterateEstimated ));
389405 double logSelectivity = -Math .log10 (queryPlanInfo .selectivityEstimated );
390406 logSelectivityEstimated .update ((int ) (Math .min (20 , Math .floor (logSelectivity ))));
391407 indexReferencesInQuery .update (queryPlanInfo .indexReferencesInQuery );
0 commit comments