Index advisor flags

This page describes the database flags that AlloyDB for PostgreSQL uses to enable and manage features specific to its index advisor extension.

Database flags

google_db_advisor.auto_advisor_max_time_in_seconds
TypeInteger
Default1800
Restart requiredNo

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
TypeString
Default'EVERY 24 HOURS'
Restart requiredNo

Defines the frequency of the index advisor's automated analysis. The value is a single-quoted string of the format 'EVERY N UNITS', where N is an integer, and UNITS is either HOURS or DAYS.

google_db_advisor.enable_auto_advisor
TypeBoolean
Defaulton
Restart requiredNo

If on, then AlloyDB 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
TypeBoolean
Defaulton
Restart requiredYes

Controls whether the AlloyDB index advisor is enabled.

google_db_advisor.max_index_width
TypeInteger
Default2
Restart requiredNo

The maximum number of columns that a recommended index can contain.

google_db_advisor.max_num_indexable_columns
TypeInteger
Default1000
Restart requiredNo

The maximum number of indexable columns that index advisor tracks.

google_db_advisor.max_statement_length
TypeInteger
Default102400
Restart requiredNo

The maximum length, in bytes, of queries that the index advisor tracks.

google_db_advisor.max_storage_size_in_mb
TypeInteger
Default0
Restart requiredNo

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

If set to 0, then AlloyDB uses the current database size as the upper limit on the total size of recommended indexes.

google_db_advisor.recommend_indexes_on_partitions
TypeBoolean
Defaultoff
Restart requiredNo

Controls whether to enable recommending indexes on individual table partitions.

google_db_advisor.recommendation_max_time_in_seconds
TypeInteger
Default600
Restart requiredNo

The maximum time, in seconds, that the index advisor spends running an analysis of its tracked queries.

google_db_advisor.top_k_slowest_statements
TypeInteger
Default100
Restart requiredNo

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 recommends indexes based on all captured statements, instead of on a limited number of statements.