Edit

Configure autonomous tuning in Azure Database for PostgreSQL flexible server

You can enable, disable, and configure autonomous tuning through a set of parameters that control its behavior, such as how often a tuning session should run.

Autonomous tuning depends on the data that query store persists locally to the azure_sys database. Don't enable query store on the Burstable pricing tier, due to the performance implications it might have. For the same reason, don't use autonomous tuning for servers that use compute from the Burstable tier.

Autonomous tuning is an opt-in feature that's disabled by default on a server. You can enable or disable it globally for all databases on a given server. You can't turn it on or off per database.

Steps to enable autonomous tuning

Use the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

  2. In the resource menu, under Intelligent Performance, select Autonomous tuning.

    Screenshot that shows the Autonomous tuning menu option under the Intelligent Performance section, to enable autonomous tuning.

  3. If either pg_qs.query_capture_mode is set to none or index_tuning.mode is set to off, the Autonomous tuning page gives you the option to enable autonomous tuning. Select on either of the two Enable tuning buttons, to enable autonomous tuning feature and its required query store dependency, if query store is disabled.

    Screenshot that shows how to enable autonomous tuning through the Autonomous tuning page.

  4. Wait for the deployment to complete successfully before considering that the feature is enabled.

    Screenshot that shows the deployment completed to enable autonomous tuning.

  5. After enabling autonomous tuning, allow up to 12 hours for the autonomous tuning engine to analyze the workload collected by query store during that time, and eventually produce recommendations.

Important

When you enable autonomous tuning by using the Enable tuning button, if pg_qs.query_capture_mode is set to none, the process changes it to all. If it's already set to top or all, the process leaves it unchanged.

Steps to disable autonomous tuning

Use the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

  2. In the resource menu, under Intelligent Performance, select Autonomous tuning.

    Screenshot that shows the Autonomous tuning menu option under the Intelligent Performance section, to disable autonomous tuning.

  3. Select Disable tuning to disable the feature.

    Screenshot that shows how to disable autonomous tuning through the Autonomous tuning page.

  4. Wait for the deployment to complete successfully before considering that the feature is disabled.

    Screenshot that shows the deployment completed to disable autonomous tuning.

  5. Assess whether you want to continue using query store to monitor the performance of your workload and leave it enabled or, if you want to disable it, do so by setting pg_qs.query_capture_mode to none.

Important

When autonomous tuning is disabled through the Disable tuning button, parameter pg_qs.query_capture_mode isn't set to none, but left as it is configured.

Steps to show the state of autonomous tuning

Use the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

  2. In the resource menu, under Intelligent Performance, select Autonomous tuning.

    Screenshot that shows the Autonomous tuning menu option under the Intelligent Performance section, to disable autonomous tuning.

  3. If autonomous tuning is enabled, the page displays the Disable tuning button.

    Screenshot that shows the aspect of the Autonomous tuning page when the feature is enabled.

  4. If autonomous tuning is disabled, the page displays the Enable tuning button.

    Screenshot that shows the aspect of the Autonomous tuning page when the feature is disabled.

Steps to list autonomous tuning settings

Use the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

  2. In the resource menu, under Intelligent Performance, select Autonomous tuning.

    Screenshot that shows the Autonomous tuning menu option under the Intelligent Performance section, to disable autonomous tuning.

  3. Select Tuning settings.

    Screenshot that shows the Tune settings button in the Autonomous tuning page.

Steps to modify autonomous tuning settings

Use the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

  2. In the resource menu, under Intelligent Performance, select Autonomous tuning.

    Screenshot that shows the Autonomous tuning menu option under the Intelligent Performance section, to disable autonomous tuning.

  3. Select Tuning settings.

    Screenshot that shows the Tune settings button in the Autonomous tuning page.

  4. Modify the values of as many settings as you want to change, and select Save.

    Screenshot that shows the aspect of the Autonomous tuning page when the feature is enabled.

  5. Wait for the deployment to complete successfully before considering that the value of the settings is changed.

    Screenshot that shows a successfully completed deployment to modify one or more autonomous tuning settings.