Select a documentation version: <button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">15.13.0</button>

- [Current (18.4.0)](https://docs.cloud.google.com/alloydb/omni/kubernetes/current/docs/reference/index-advisor-flags.md.txt)
- [18.4.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.4.0/docs/reference/index-advisor-flags.md.txt)
- [18.3.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.3.0/docs/reference/index-advisor-flags.md.txt)
- [18.1.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.1.0/docs/reference/index-advisor-flags.md.txt)
- [17.10.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.10.0/docs/reference/index-advisor-flags.md.txt)
- [17.9.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.9.0/docs/reference/index-advisor-flags.md.txt)
- [17.7.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.7.0/docs/reference/index-advisor-flags.md.txt)
- [17.5.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.5.0/docs/reference/index-advisor-flags.md.txt)
- [16.14.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.14.0/docs/reference/index-advisor-flags.md.txt)
- [16.13.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.13.0/docs/reference/index-advisor-flags.md.txt)
- [16.11.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.11.0/docs/reference/index-advisor-flags.md.txt)
- [16.9.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.9.0/docs/reference/index-advisor-flags.md.txt)
- [16.8.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.8.0/docs/reference/index-advisor-flags.md.txt)
- [16.3.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.3.0/docs/reference/index-advisor-flags.md.txt)
- [15.18.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.18.0/docs/reference/index-advisor-flags.md.txt)
- [15.17.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.17.0/docs/reference/index-advisor-flags.md.txt)
- [15.15.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.15.0/docs/reference/index-advisor-flags.md.txt)
- [15.13.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.13.0/docs/reference/index-advisor-flags.md.txt)
- [15.12.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.12.0/docs/reference/index-advisor-flags.md.txt)
- [15.7.1](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.1/docs/reference/index-advisor-flags.md.txt)
- [15.7.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.0/docs/reference/index-advisor-flags.md.txt)

<br />

This page describes the database flags that AlloyDB Omni uses to enable and manage features specific to [its index advisor
extension](https://docs.cloud.google.com/alloydb/docs/use-index-advisor). For a list of all database flags that AlloyDB Omni supports, see [Supported database
flags](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.13.0/docs/reference/database-flags).

<br />

For instructions about how to set a database flag, see

[Configure AlloyDB Omni database flags](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.13.0/docs/configure-database-flags.md.txt).


## Database flags

`google_db_advisor.auto_advisor_max_time_in_seconds_per_day` Type`Integer` Default`1800` Restart required`No`

The maximum time, in seconds per day, that the index advisor spends
running automated analyses of its tracked queries.
`google_db_advisor.auto_advisor_schedule` Type`String` Default`'EVERY 24 HOURS'` Restart required`No`

Defines the frequency of the index advisor's automated
analysis. The value is a single-quoted string of the format
`'EVERY N UNITS'`, where
<var translate="no">N</var> is an integer, and <var translate="no">UNITS</var> is either
`HOURS` or `DAYS`.
`google_db_advisor.enable_auto_advisor` Type`Boolean` Default`on` Restart required`No`

If `on`, then AlloyDB Omni runs the
index advisor's analysis on an automated schedule, with a
frequency set by the separate
`google_db_advisor.auto_advisor_schedule` flag.
`google_db_advisor.enabled` Type`Boolean` Default`on` Restart required`Yes`

Controls whether the AlloyDB Omni [index advisor](https://docs.cloud.google.com/alloydb/docs/use-index-advisor.md.txt) is
enabled.
`google_db_advisor.max_index_width` Type`Integer` Default`2` Restart required`No`

The maximum number of columns that a recommended index can
contain.
`google_db_advisor.max_num_indexable_columns` Type`Integer` Default`1000` Restart required`No`

The maximum number of indexable columns that index advisor
tracks.
`google_db_advisor.max_statement_length` Type`Integer` Default`102400` Restart required`No`

The maximum length, in bytes, of queries that the index
advisor tracks.
`google_db_advisor.max_storage_size_in_mb` Type`Integer` Default`0` Restart required`No`

The maximum total size, in megabytes, of the indexes
that the index advisor recommends.

If set to `0`, then AlloyDB Omni uses the
current database size as the upper limit on the total size of
recommended indexes.
`google_db_advisor.recommendation_max_time_in_seconds` Type`Integer` Default`600` Restart required`No`

The maximum time, in seconds, that the index advisor spends
running an analysis of its tracked queries.
`google_db_advisor.recommend_indexes_on_partitions` Type`Boolean` Default`off` Restart required`No`

Controls whether to enable recommending indexes on
individual table partitions.
`google_db_advisor.top_k_slowest_statements` Type`Integer` Default`100` Restart required`No`

The index advisor bases its recommendations on the
slowest-executing statements out of all the queries it tracks.
The value set by this flag defines the size of this
set.

If set to `2147483647` (the maximum allowed
value), then AlloyDB Omni recommends indexes based
on all captured statements, instead of on a limited number of
statements.