---
title: "POST /v1beta/{+parent}:aggregateQueryStats"
method: POST
path: "/v1beta/{+parent}:aggregateQueryStats"
tags: ["organizations"]
---

# POST /v1beta/{+parent}:aggregateQueryStats

`POST /v1beta/{+parent}:aggregateQueryStats`

AggregateQueryStats provides database resource query execution statistics.

## Path parameters

- `parent` string, required

## Request body

- AggregateQueryStatsRequest — AggregateQueryStatsRequest represents the input to the AggregateQueryStats method.
  - `orderBy` string — Optional. The expression to order the results by. Example: `order_by="execution_count"` Example: `order_by="execution_count desc"` Supported order by fields are `execution_count`, `rows_processed`, `total_cpu_time`, `avg_cpu_time`.
  - `filter` string — Optional. The expression to filter resources. Supported fields are: `full_resource_name`, `resource_type`, `container`, `product.type`, `product.engine`, `product.version`, `location`, `labels`, `issues`, fields of availability_info, data_protection_info,'resource_name', etc. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. When `AND` and `OR` are both used in the expression, parentheses must be appropriately used to group the combinations. Example: `location="us-east1"` Example: `container="projects/123" OR container="projects/456"` Example: `(container="projects/123" OR container="projects/456") AND location="us-east1"` Additional specific fields for query stats are: `metric_window`, `query_hash`, `normalized_query`. Example: `metric_window="LAST_ONE_DAY"` (Possible values for `metric_window` are: `LAST_ONE_DAY`, `LAST_ONE_WEEK`, `LAST_TWO_WEEKS`) Example: `query_hash="12345678"` Example: `normalized_query="SELECT * FROM table"`
  - `pageSize` integer — Optional. If unspecified, at most 100 query stats will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  - `pageToken` string — Optional. A page token, received from a previous `AggregateQueryStatsRequest` call. Provide this to retrieve the subsequent page. All parameters except page_token should match the parameters in the call that provided the page token.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/databasecenter.md) · [All operations](https://skmtc.dev/google/apis/databasecenter/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/databasecenter/revisions/c8a8fc88f9cf/schema)
