Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc][2025.1] Auto analyze service tserver and master flags #25097

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
12 changes: 12 additions & 0 deletions docs/content/preview/reference/configuration/yb-master.md
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,18 @@ expensive when the number of yb-tservers, or the number of databases goes up.

{{< /note >}}

## Auto Analyze Service flags

Auto Analyze service flags are {{<tags/feature/tp>}}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this feature is still TP, @yifanguan, could you add an idea number to this feature tag, if there is one? See this example on how to do it: https://github.com/yugabyte/yugabyte-db/blob/3b2bac3e9288c3c68af9b89fb1c42fb8b87dbf0e/docs/content/stable/develop/best-practices-ysql.md?plain=1#L187C1-L187C358

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do the same in other places if you have mentioned feature tags in changes?


See also [Auto Analyze Service TServer flags](../yb-tserver/#auto-analyze-service-flags).

##### ysql_enable_auto_analyze_service

Enable the Auto Analyze service which automatically runs ANALYZEs to update table statistics for tables which have changed more than a configurable threshold.

Default: false

## Advanced flags

##### --allowed_preview_flags_csv
Expand Down
67 changes: 67 additions & 0 deletions docs/content/preview/reference/configuration/yb-tserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,73 @@ After a DDL statement that includes updating DocDB system catalog completes, YB-
When the flag `ysql_ddl_transaction_wait_for_ddl_verification` is enabled, YSQL waits for any YB-Master background operations to finish before returning control to the user.
{{< /note >}}

## Auto Analyze Service flags

Auto Analyze service flags are {{<tags/feature/tp>}}.

{{< note title="Note" >}}

To fully enable Auto Analyze service, you need to enable `ysql_enable_auto_analyze_service` on all YB-Masters and YB-TServers, as well as `ysql_enable_table_mutation_counter` on all YB-TServers.

{{< /note >}}

See also [Auto Analyze Service Master flags](../yb-master#auto-analyze-service-flags).

##### ysql_enable_auto_analyze_service

Enable the Auto Analyze service which automatically runs ANALYZEs to update table statistics for tables which have changed more than a configurable threshold.

Default: false

##### ysql_enable_table_mutation_counter
Enable counting of mutations on a per-table basis. These mutations are used to automatically run ANALYZE as soon as the mutations of a table cross
a certain threshold (decided based on [ysql_auto_analyze_threshold](#ysql-auto-analyze-threshold) and [ysql_auto_analyze_scale_factor](#ysql-auto-analyze-scale-factor)).

Default: false

##### ysql_auto_analyze_threshold

The minimum number of mutations needed to run ANALYZE on a table.

Default: 50

##### ysql_auto_analyze_scale_factor

The fraction defining when sufficient mutations have been accumulated to run ANALYZE for a table.
ANALYZE runs when the mutation count becomes larger than `ysql_auto_analyze_scale_factor * <table_size> + ysql_auto_analyze_threshold`.

Default: 0.1

##### ysql_auto_analyze_batch_size

The max number of tables the auto analyze service tries to analyze in a single ANALYZE statement.

Default: 10

##### ysql_cluster_level_mutation_persist_interval_ms

Interval at which the reported node level table mutation counts are persisted to the underlying auto-analyze mutations table.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the "auto-analyze mutations table"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a service table the auto analyze service uses to persist its state.


Default: 10000

##### ysql_cluster_level_mutation_persist_rpc_timeout_ms

Timeout for the rpcs used to persist mutation counts in the auto-analyze mutations table.

Default: 10000

##### ysql_node_level_mutation_reporting_interval_ms

Interval at which the node level table mutation counts are sent to the auto analyze service which tracks table mutation counts at the cluster level.

Default: 5000

##### ysql_node_level_mutation_reporting_timeout_ms

Timeout for the node level mutation reporting rpc to auto-analyze service.

Default: 5000

## Advanced flags

##### backfill_index_client_rpc_timeout_ms
Expand Down