# Google Cloud Database Center V1beta Client - Class QueryStats (0.7.0)

0.7.0 (latest) 0.6.0 0.5.0 0.4.1 0.3.1 0.2.0 0.1.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Database Center V1beta Client class QueryStats.

QueryStats contains the stats for a particular combination of query_hash,
query_string and resource_type.

Generated from protobuf message `google.cloud.databasecenter.v1beta.QueryStats`

## Namespace

Google \\ Cloud \\ DatabaseCenter \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ query_hash` | `string` The query hash of the query. |
| `↳ normalized_query` | `string` The query string is normalized query without any PII data. |
| `↳ resource_type` | `string` The type of the resource. sqladmin.googleapis.com/Instance alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance |
| `↳ resource_ids` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.ResourceId>` The resource ids for which the query stats are collected. |
| `↳ query_metrics` | `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.QueryMetrics` Metrics related to the query performance. |
| `↳ inefficient_query_info` | `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.InefficientQueryInfo` Information about inefficient query. |

### getQueryHash

The query hash of the query.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setQueryHash

The query hash of the query.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNormalizedQuery

The query string is normalized query without any PII data.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setNormalizedQuery

The query string is normalized query without any PII data.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceType

The type of the resource.

sqladmin.googleapis.com/Instance
alloydb.googleapis.com/Cluster
alloydb.googleapis.com/Instance

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setResourceType

The type of the resource.

sqladmin.googleapis.com/Instance
alloydb.googleapis.com/Cluster
alloydb.googleapis.com/Instance

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceIds

The resource ids for which the query stats are collected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.ResourceId>` |   |

### setResourceIds

The resource ids for which the query stats are collected.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.ResourceId>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQueryMetrics

Metrics related to the query performance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.QueryMetrics|null` |   |

### hasQueryMetrics

### clearQueryMetrics

### setQueryMetrics

Metrics related to the query performance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.QueryMetrics` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInefficientQueryInfo

Information about inefficient query.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.InefficientQueryInfo|null` |   |

### hasInefficientQueryInfo

### clearInefficientQueryInfo

### setInefficientQueryInfo

Information about inefficient query.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.InefficientQueryInfo` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |