ResultSetStats

Additional statistics about aResultSet orPartialResultSet.

JSON representation
{"queryPlan":{object (QueryPlan)},"queryStats":{object},// Union fieldrow_count can be only one of the following:"rowCountExact":string,"rowCountLowerBound":string// End of list of possible types for union fieldrow_count.}
Fields
queryPlan

object (QueryPlan)

QueryPlan for the query associated with this result.

queryStats

object (Struct format)

Aggregated statistics from the execution of the query. Only present when the query is profiled. For example, a query could return the statistics as follows:

{  "rows_returned": "3",  "elapsed_time": "1.22 secs",  "cpu_time": "1.19 secs"}
Union fieldrow_count. The number of rows modified by the DML statement.row_count can be only one of the following:
rowCountExact

string (int64 format)

Standard DML returns an exact count of rows that were modified.

rowCountLowerBound

string (int64 format)

Partitioned DML doesn't offer exactly-once semantics, so it returns a lower bound of the rows modified.

QueryPlan

Contains an ordered list of nodes appearing in the query plan.

JSON representation
{"planNodes":[{object (PlanNode)}],"queryAdvice":{object (QueryAdvisorResult)}}
Fields
planNodes[]

object (PlanNode)

The nodes in the query plan. Plan nodes are returned in pre-order starting with the plan root. EachPlanNode'sid corresponds to its index inplanNodes.

queryAdvice

object (QueryAdvisorResult)

Optional. The advise/recommendations for a query. Currently this field will be serving index recommendations for a query.

PlanNode

Node information for nodes appearing in aQueryPlan.plan_nodes.

JSON representation
{"index":integer,"kind":enum (Kind),"displayName":string,"childLinks":[{object (ChildLink)}],"shortRepresentation":{object (ShortRepresentation)},"metadata":{object},"executionStats":{object}}
Fields
index

integer

ThePlanNode's index innode list.

kind

enum (Kind)

Used to determine the type of node. May be needed for visualizing different kinds of nodes differently. For example, If the node is aSCALAR node, it will have a condensed representation which can be used to directly embed a description of the node in its parent.

displayName

string

The display name for the node.

childLinks[]

object (ChildLink)

List of child nodeindexes and their relationship to this parent.

shortRepresentation

object (ShortRepresentation)

Condensed representation forSCALAR nodes.

metadata

object (Struct format)

Attributes relevant to the node contained in a group of key-value pairs. For example, a Parameter Reference node could have the following information in its metadata:

{  "parameter_reference": "param1",  "parameterType": "array"}
executionStats

object (Struct format)

The execution statistics associated with the node, contained in a group of key-value pairs. Only present if the plan was returned as a result of a profile query. For example, number of executions, number of rows/time per execution etc.

Kind

The kind ofPlanNode. Distinguishes between the two different kinds of nodes that can appear in a query plan.

Enums
KIND_UNSPECIFIEDNot specified.
RELATIONALDenotes a Relational operator node in the expression tree. Relational operators represent iterative processing of rows during query execution. For example, aTableScan operation that reads rows from a table.
SCALARDenotes a Scalar node in the expression tree. Scalar nodes represent non-iterable entities in the query plan. For example, constants or arithmetic operators appearing inside predicate expressions or references to column names.

ChildLink

Metadata associated with a parent-child relationship appearing in aPlanNode.

JSON representation
{"childIndex":integer,"type":string,"variable":string}
Fields
childIndex

integer

The node to which the link points.

type

string

The type of the link. For example, in Hash Joins this could be used to distinguish between the build child and the probe child, or in the case of the child being an output variable, to represent the tag associated with the output variable.

variable

string

Only present if the child node isSCALAR and corresponds to an output variable of the parent node. The field carries the name of the output variable. For example, aTableScan operator that reads rows from a table will have child links to theSCALAR nodes representing the output variables created for each column that is read by the operator. The correspondingvariable fields will be set to the variable names assigned to the columns.

ShortRepresentation

Condensed representation of a node and its subtree. Only present forSCALARPlanNode(s).

JSON representation
{"description":string,"subqueries":{string:integer,...}}
Fields
description

string

A string representation of the expression subtree rooted at this node.

subqueries

map (key: string, value: integer)

A mapping of (subquery variable name) -> (subquery node id) for cases where thedescription string of this node references aSCALAR subquery contained in the expression subtree rooted at this node. The referencedSCALAR subquery may not necessarily be a direct child of this node.

QueryAdvisorResult

Output of query advisor analysis.

JSON representation
{"indexAdvice":[{object (IndexAdvice)}]}
Fields
indexAdvice[]

object (IndexAdvice)

Optional. Index Recommendation for a query. This is an optional field and the recommendation will only be available when the recommendation guarantees significant improvement in query performance.

IndexAdvice

Recommendation to add new indexes to run queries more efficiently.

JSON representation
{"ddl":[string],"improvementFactor":number}
Fields
ddl[]

string

Optional. DDL statements to add new indexes that will improve the query.

improvementFactor

number

Optional. Estimated latency improvement factor. For example if the query currently takes 500 ms to run and the estimated latency with new indexes is 100 ms this field will be 5.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-30 UTC.