Επεξεργασία

Κοινή χρήση μέσω


Configure index tuning

APPLIES TO: Azure Database for PostgreSQL - Flexible Server

Index tuning can be enabled, disabled, and configured through a set of parameters that control its behavior, such as how often a tuning session can run.

Index tuning depends on query store. We don't recommend enabling query store on the Burstable pricing tier, due to the performance implications it might have. For the same reason, index tuning isn't recommended for servers using compute from the Burstable tier.

Index tuning is an opt-in feature that isn't enabled by default on a server. It can be enabled or disabled globally for all databases on a given server and can't be turned on or off per database.

Steps to enable index tuning

Using the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

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

    Screenshot that shows the Index tuning menu option under the Intelligent Performance section, to enable index tuning.

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

    Screenshot that shows how to enable index tuning through the Index 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 index tuning.

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

Important

When index tuning is enabled through the Enable index tuning button, if pg_qs.query_capture_mode is set to NONE, it's changed to ALL. If it was already set to either TOP or ALL, it's left in its current state.

Steps to disable index tuning

Using the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

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

    Screenshot that shows the Index tuning menu option under the Intelligent Performance section, to disable index tuning.

  3. Select Disable index tuning to disable the feature.

    Screenshot that shows how to disable index tuning through the Index 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 index tuning.

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

Important

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

Steps to show the state of index tuning

Using the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

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

    Screenshot that shows the Index tuning menu option under the Intelligent Performance section, to disable index tuning.

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

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

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

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

Steps to list index tuning settings

Using the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

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

    Screenshot that shows the Index tuning menu option under the Intelligent Performance section, to disable index tuning.

  3. Select Tuning settings.

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

Steps to modify index tuning settings

Using the Azure portal:

  1. Select your Azure Database for PostgreSQL flexible server.

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

    Screenshot that shows the Index tuning menu option under the Intelligent Performance section, to disable index tuning.

  3. Select Tuning settings.

    Screenshot that shows the Tune settings button in the Index 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 Index 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 index tuning settings.