ExplainMetrics
Stay organized with collections
Save and categorize content based on your preferences.
Explain metrics for the query.
PlanSummary
Planning phase information for the query.
JSON representation |
{
"indexesUsed": [
{
object
}
]
} |
Fields |
indexesUsed[] |
object (Struct format)
The indexes selected for the query. For example: [ {"queryScope": "Collection", "properties": "(foo ASC, name ASC)"}, {"queryScope": "Collection", "properties": "(bar ASC, name ASC)"} ]
|
ExecutionStats
Execution statistics for the query.
JSON representation |
{
"resultsReturned": string,
"executionDuration": string,
"readOperations": string,
"debugStats": {
object
}
} |
Fields |
resultsReturned |
string (int64 format)
Total number of results returned, including documents, projections, aggregation results, keys.
|
executionDuration |
string (Duration format)
Total time to execute the query in the backend. A duration in seconds with up to nine fractional digits, ending with 's '. Example: "3.5s" .
|
readOperations |
string (int64 format)
Total billable read operations.
|
debugStats |
object (Struct format)
Debugging statistics from the execution of the query. Note that the debugging stats are subject to change as Firestore evolves. It could include: { "indexes_entries_scanned": "1000", "documents_scanned": "20", "billing_details" : { "documents_billable": "20", "index_entries_billable": "1000", "min_query_cost": "0" } }
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-20 UTC.
[null,null,["Last updated 2025-06-20 UTC."],[],[],null,["# ExplainMetrics\n\nExplain metrics for the query.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"planSummary\": { object (/docs/firestore/reference/rest/v1/ExplainMetrics#PlanSummary) }, \"executionStats\": { object (/docs/firestore/reference/rest/v1/ExplainMetrics#ExecutionStats) } } ``` |\n\n| Fields ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `planSummary` | `object (`[PlanSummary](/docs/firestore/reference/rest/v1/ExplainMetrics#PlanSummary)`)` Planning phase information for the query. |\n| `executionStats` | `object (`[ExecutionStats](/docs/firestore/reference/rest/v1/ExplainMetrics#ExecutionStats)`)` Aggregated stats from the execution of the query. Only present when [ExplainOptions.analyze](/docs/firestore/reference/rest/v1/ExplainOptions#FIELDS.analyze) is set to true. |\n\nPlanSummary\n-----------\n\nPlanning phase information for the query.\n\n| JSON representation |\n|-------------------------------------------|\n| ``` { \"indexesUsed\": [ { object } ] } ``` |\n\n| Fields ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `indexesUsed[]` | `object (`[Struct](https://protobuf.dev/reference/protobuf/google.protobuf/#struct)` format)` The indexes selected for the query. For example: \\[ {\"queryScope\": \"Collection\", \"properties\": \"(foo ASC, **name** ASC)\"}, {\"queryScope\": \"Collection\", \"properties\": \"(bar ASC, **name** ASC)\"} \\] |\n\nExecutionStats\n--------------\n\nExecution statistics for the query.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"resultsReturned\": string, \"executionDuration\": string, \"readOperations\": string, \"debugStats\": { object } } ``` |\n\n| Fields ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `resultsReturned` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Total number of results returned, including documents, projections, aggregation results, keys. |\n| `executionDuration` | `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` Total time to execute the query in the backend. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n| `readOperations` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Total billable read operations. |\n| `debugStats` | `object (`[Struct](https://protobuf.dev/reference/protobuf/google.protobuf/#struct)` format)` Debugging statistics from the execution of the query. Note that the debugging stats are subject to change as Firestore evolves. It could include: { \"indexes_entries_scanned\": \"1000\", \"documents_scanned\": \"20\", \"billing_details\" : { \"documents_billable\": \"20\", \"index_entries_billable\": \"1000\", \"min_query_cost\": \"0\" } } |"]]