Tuning Options - List Recommendations

Lists available object recommendations.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/recommendations?api-version=2026-10-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/tuningOptions/{tuningOption}/recommendations?api-version=2026-10-01&recommendationType={recommendationType}

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

serverName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*

The name of the server.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

tuningOption
path True

TuningOptionParameterEnum

The name of the tuning option.

api-version
query True

string

minLength: 1

The API version to use for this operation.

recommendationType
query

RecommendationTypeParameterEnum

Recommendations list filter. Retrieves recommendations based on type.

Responses

Name Type Description
200 OK

ObjectRecommendationList

Azure operation completed successfully.

Other Status Codes

ErrorResponse

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

List available index recommendations, filtered to exclusively get those of CREATE INDEX type.
List available index recommendations.
List available table recommendations, filtered to exclusively get those of ANALYZE TABLE type.
List available table recommendations.

List available index recommendations, filtered to exclusively get those of CREATE INDEX type.

Sample request

GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations?api-version=2026-10-01&recommendationType=CreateIndex

Sample response

{
  "value": [
    {
      "name": "CreateIndex_ecommerce_public_ps_suppkey_idx",
      "type": "Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index",
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations/1",
      "kind": "",
      "properties": {
        "analyzedWorkload": {
          "endTime": "2025-06-01T20:30:22.123456Z",
          "queryCount": 25,
          "startTime": "2025-06-01T19:30:22.123456Z"
        },
        "estimatedImpact": [
          {
            "absoluteValue": 15.3671875,
            "dimensionName": "IndexSize",
            "unit": "MB"
          },
          {
            "absoluteValue": 99.67668452400453,
            "dimensionName": "QueryCostImprovement",
            "queryId": -3775242682326862300,
            "unit": "Percentage"
          },
          {
            "absoluteValue": 85.56742436827899,
            "dimensionName": "QueryCostImprovement",
            "queryId": 6829938984138799000,
            "unit": "Percentage"
          }
        ],
        "implementationDetails": {
          "method": "SQL",
          "script": "create index concurrently ps_suppkey_idx on public.partsupp(ps_suppkey)"
        },
        "improvedQueryIds": [
          -3775242682326862300,
          6829938984138799000
        ],
        "initialRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "lastRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "recommendationReason": "Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query 6829938984138799352;",
        "recommendationType": "CreateIndex",
        "timesRecommended": 1,
        "details": {
          "schema": "public",
          "databaseName": "ecommerce",
          "indexColumns": [
            "\"partsupp\".\"ps_suppkey\""
          ],
          "indexName": "ps_suppkey_idx",
          "indexType": "BTREE",
          "table": "partsupp"
        }
      }
    },
    {
      "name": "CreateIndex_ecommerce_public_ps_partkey_idx",
      "type": "Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index",
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations/2",
      "kind": "",
      "properties": {
        "analyzedWorkload": {
          "endTime": "2025-06-01T20:30:22.123456Z",
          "queryCount": 25,
          "startTime": "2025-06-01T19:30:22.123456Z"
        },
        "estimatedImpact": [
          {
            "absoluteValue": 15.3671875,
            "dimensionName": "IndexSize",
            "unit": "MB"
          },
          {
            "absoluteValue": 99.67668452400453,
            "dimensionName": "QueryCostImprovement",
            "queryId": -3775242682326862300,
            "unit": "Percentage"
          },
          {
            "absoluteValue": 79.06603712430707,
            "dimensionName": "QueryCostImprovement",
            "queryId": 4735984994430715000,
            "unit": "Percentage"
          }
        ],
        "implementationDetails": {
          "method": "SQL",
          "script": "create index concurrently ps_partkey_idx on public.partsupp(ps_partkey)"
        },
        "improvedQueryIds": [
          -3775242682326862300,
          4735984994430715000
        ],
        "initialRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "lastRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "recommendationReason": "Column \"partsupp\".\"ps_partkey\" appear in Equal Predicate clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_partkey\" appear in Join On clause(s) in query 4735984994430714735;",
        "recommendationType": "CreateIndex",
        "timesRecommended": 1,
        "details": {
          "schema": "public",
          "databaseName": "ecommerce",
          "indexColumns": [
            "\"partsupp\".\"ps_partkey\""
          ],
          "indexName": "ps_partkey_idx",
          "indexType": "BTREE",
          "table": "partsupp"
        }
      }
    }
  ]
}

List available index recommendations.

Sample request

GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations?api-version=2026-10-01

Sample response

{
  "value": [
    {
      "name": "CreateIndex_ecommerce_public_ps_suppkey_idx",
      "type": "Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index",
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations/1",
      "kind": "",
      "properties": {
        "analyzedWorkload": {
          "endTime": "2025-06-01T20:30:22.123456Z",
          "queryCount": 25,
          "startTime": "2025-06-01T19:30:22.123456Z"
        },
        "estimatedImpact": [
          {
            "absoluteValue": 15.3671875,
            "dimensionName": "IndexSize",
            "unit": "MB"
          },
          {
            "absoluteValue": 99.67668452400453,
            "dimensionName": "QueryCostImprovement",
            "queryId": -3775242682326862300,
            "unit": "Percentage"
          },
          {
            "absoluteValue": 85.56742436827899,
            "dimensionName": "QueryCostImprovement",
            "queryId": 6829938984138799000,
            "unit": "Percentage"
          }
        ],
        "implementationDetails": {
          "method": "SQL",
          "script": "create index concurrently ps_suppkey_idx on public.partsupp(ps_suppkey)"
        },
        "improvedQueryIds": [
          -3775242682326862300,
          6829938984138799000
        ],
        "initialRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "lastRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "recommendationReason": "Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_suppkey\" appear in Join On clause(s) in query 6829938984138799352;",
        "recommendationType": "CreateIndex",
        "timesRecommended": 1,
        "details": {
          "schema": "public",
          "databaseName": "ecommerce",
          "indexColumns": [
            "\"partsupp\".\"ps_suppkey\""
          ],
          "indexName": "ps_suppkey_idx",
          "indexType": "BTREE",
          "table": "partsupp"
        }
      }
    },
    {
      "name": "CreateIndex_ecommerce_public_ps_partkey_idx",
      "type": "Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/index",
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/index/recommendations/2",
      "kind": "",
      "properties": {
        "analyzedWorkload": {
          "endTime": "2025-06-01T20:30:22.123456Z",
          "queryCount": 25,
          "startTime": "2025-06-01T19:30:22.123456Z"
        },
        "estimatedImpact": [
          {
            "absoluteValue": 15.3671875,
            "dimensionName": "IndexSize",
            "unit": "MB"
          },
          {
            "absoluteValue": 99.67668452400453,
            "dimensionName": "QueryCostImprovement",
            "queryId": -3775242682326862300,
            "unit": "Percentage"
          },
          {
            "absoluteValue": 79.06603712430707,
            "dimensionName": "QueryCostImprovement",
            "queryId": 4735984994430715000,
            "unit": "Percentage"
          }
        ],
        "implementationDetails": {
          "method": "SQL",
          "script": "create index concurrently ps_partkey_idx on public.partsupp(ps_partkey)"
        },
        "improvedQueryIds": [
          -3775242682326862300,
          4735984994430715000
        ],
        "initialRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "lastRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "recommendationReason": "Column \"partsupp\".\"ps_partkey\" appear in Equal Predicate clause(s) in query -3775242682326862475; Column \"partsupp\".\"ps_partkey\" appear in Join On clause(s) in query 4735984994430714735;",
        "recommendationType": "CreateIndex",
        "timesRecommended": 1,
        "details": {
          "schema": "public",
          "databaseName": "ecommerce",
          "indexColumns": [
            "\"partsupp\".\"ps_partkey\""
          ],
          "indexName": "ps_partkey_idx",
          "indexType": "BTREE",
          "table": "partsupp"
        }
      }
    }
  ]
}

List available table recommendations, filtered to exclusively get those of ANALYZE TABLE type.

Sample request

GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations?api-version=2026-10-01&recommendationType=AnalyzeTable

Sample response

{
  "value": [
    {
      "name": "Analyze_postgres_public_nation",
      "type": "Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/table",
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations/1",
      "kind": "",
      "properties": {
        "analyzedWorkload": {
          "endTime": "2025-06-01T20:30:22.123456Z",
          "queryCount": 22,
          "startTime": "2025-06-01T19:30:22.123456Z"
        },
        "estimatedImpact": [],
        "implementationDetails": {
          "method": "SQL",
          "script": "analyze table public.nation"
        },
        "improvedQueryIds": [
          2071439792137543700,
          7860150533486302000,
          6411979446509506000,
          3219604056681277400,
          -360410933364310600,
          6171467644166225000,
          3548728559597612500,
          -4753875211349607000,
          -8711548294430095000
        ],
        "initialRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "lastRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "recommendationReason": "Table \"nation\" in schema \"public\" is unanalyzed and appears in the following queries: 2071439792137543669, 7860150533486301820, 6411979446509505239, 3219604056681277471, -360410933364310591, 6171467644166224729, 3548728559597612316, -4753875211349607298, -8711548294430094920",
        "recommendationType": "Analyze",
        "timesRecommended": 1,
        "details": {
          "schema": "public",
          "databaseName": "postgres",
          "table": "nation"
        }
      }
    },
    {
      "name": "Analyze_postgres_public_region",
      "type": "Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/table",
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations/2",
      "kind": "",
      "properties": {
        "analyzedWorkload": {
          "endTime": "2025-06-01T20:30:22.123456Z",
          "queryCount": 22,
          "startTime": "2025-06-01T19:30:22.123456Z"
        },
        "estimatedImpact": [],
        "implementationDetails": {
          "method": "SQL",
          "script": "analyze table public.region"
        },
        "improvedQueryIds": [
          3219604056681277400,
          6171467644166225000,
          -4753875211349607000
        ],
        "initialRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "lastRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "recommendationReason": "Table \"region\" in schema \"public\" is unanalyzed and appears in the following queries: 3219604056681277471, 6171467644166224729, -4753875211349607298",
        "recommendationType": "Analyze",
        "timesRecommended": 1,
        "details": {
          "schema": "public",
          "databaseName": "postgres",
          "table": "region"
        }
      }
    }
  ]
}

List available table recommendations.

Sample request

GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations?api-version=2026-10-01

Sample response

{
  "value": [
    {
      "name": "Analyze_postgres_public_nation",
      "type": "Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/table",
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations/1",
      "kind": "",
      "properties": {
        "analyzedWorkload": {
          "endTime": "2025-06-01T20:30:22.123456Z",
          "queryCount": 22,
          "startTime": "2025-06-01T19:30:22.123456Z"
        },
        "estimatedImpact": [],
        "implementationDetails": {
          "method": "SQL",
          "script": "analyze table public.nation"
        },
        "improvedQueryIds": [
          2071439792137543700,
          7860150533486302000,
          6411979446509506000,
          3219604056681277400,
          -360410933364310600,
          6171467644166225000,
          3548728559597612500,
          -4753875211349607000,
          -8711548294430095000
        ],
        "initialRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "lastRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "recommendationReason": "Table \"nation\" in schema \"public\" is unanalyzed and appears in the following queries: 2071439792137543669, 7860150533486301820, 6411979446509505239, 3219604056681277471, -360410933364310591, 6171467644166224729, 3548728559597612316, -4753875211349607298, -8711548294430094920",
        "recommendationType": "Analyze",
        "timesRecommended": 1,
        "details": {
          "schema": "public",
          "databaseName": "postgres",
          "table": "nation"
        }
      }
    },
    {
      "name": "Analyze_postgres_public_region",
      "type": "Microsoft.DBforPostgreSQL/flexibleServers/tuningOptions/table",
      "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/tuningOptions/table/recommendations/2",
      "kind": "",
      "properties": {
        "analyzedWorkload": {
          "endTime": "2025-06-01T20:30:22.123456Z",
          "queryCount": 22,
          "startTime": "2025-06-01T19:30:22.123456Z"
        },
        "estimatedImpact": [],
        "implementationDetails": {
          "method": "SQL",
          "script": "analyze table public.region"
        },
        "improvedQueryIds": [
          3219604056681277400,
          6171467644166225000,
          -4753875211349607000
        ],
        "initialRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "lastRecommendedTime": "2025-06-01T20:30:22.123456Z",
        "recommendationReason": "Table \"region\" in schema \"public\" is unanalyzed and appears in the following queries: 3219604056681277471, 6171467644166224729, -4753875211349607298",
        "recommendationType": "Analyze",
        "timesRecommended": 1,
        "details": {
          "schema": "public",
          "databaseName": "postgres",
          "table": "region"
        }
      }
    }
  ]
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ImpactRecord

Impact on some metric if this recommended action is applied.

ObjectRecommendation

Object recommendation properties.

ObjectRecommendationDetails

Recommendation details for the recommended action.

ObjectRecommendationList

List of available object recommendations.

ObjectRecommendationPropertiesAnalyzedWorkload

Workload information for the recommended action.

ObjectRecommendationPropertiesImplementationDetails

Implementation details for the recommended action.

RecommendationTypeEnum

Type for this recommendation.

RecommendationTypeParameterEnum

Recommendations list filter. Retrieves recommendations based on type.

systemData

Metadata pertaining to creation and last modification of the resource.

TuningOptionParameterEnum

The name of the tuning option.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ImpactRecord

Impact on some metric if this recommended action is applied.

Name Type Description
absoluteValue

number (double)

Absolute value.

dimensionName

string

Dimension name.

queryId

integer (int64)

Optional property that can be used to store the identifier of the query, if the metric is for a specific query.

unit

string

Dimension unit.

ObjectRecommendation

Object recommendation properties.

Name Type Description
id

string (arm-id)

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

kind

string

Always empty.

name

string

The name of the resource

properties.analyzedWorkload

ObjectRecommendationPropertiesAnalyzedWorkload

Workload information for the recommended action.

properties.currentState

string

Current state.

properties.details

ObjectRecommendationDetails

Recommendation details for the recommended action.

properties.estimatedImpact

ImpactRecord[]

Estimated impact of this recommended action.

properties.implementationDetails

ObjectRecommendationPropertiesImplementationDetails

Implementation details for the recommended action.

properties.improvedQueryIds

integer[] (int64)

List of identifiers for all queries identified as targets for improvement if the recommendation is applied. The list is only populated for CREATE INDEX recommendations.

properties.initialRecommendedTime

string (date-time)

Creation time (UTC) of this recommendation.

properties.lastRecommendedTime

string (date-time)

Last time (UTC) that this recommendation was produced.

properties.recommendationReason

string

Reason for this recommendation.

properties.recommendationType

RecommendationTypeEnum

Type for this recommendation.

properties.timesRecommended

integer (int32)

Number of times this recommendation has been produced.

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

ObjectRecommendationDetails

Recommendation details for the recommended action.

Name Type Description
databaseName

string

Database name.

includedColumns

string[]

Index included columns.

indexColumns

string[]

Index columns.

indexName

string

Index name.

indexType

string

Index type.

schema

string

Schema name.

table

string

Table name.

ObjectRecommendationList

List of available object recommendations.

Name Type Description
nextLink

string (uri)

The link to the next page of items

value

ObjectRecommendation[]

The ObjectRecommendation items on this page

ObjectRecommendationPropertiesAnalyzedWorkload

Workload information for the recommended action.

Name Type Description
endTime

string (date-time)

End time (UTC) of the workload analyzed.

queryCount

integer (int32)

Number of queries from the workload that were examined to produce this recommendation. For DROP INDEX recommendations it's 0 (zero).

startTime

string (date-time)

Start time (UTC) of the workload analyzed.

ObjectRecommendationPropertiesImplementationDetails

Implementation details for the recommended action.

Name Type Description
method

string

Method of implementation for recommended action.

script

string

Implementation script for the recommended action.

RecommendationTypeEnum

Type for this recommendation.

Value Description
CreateIndex

Recommendation to create an index to improve query performance.

DropIndex

Recommendation to drop an existing index because it's duplicate or unused.

ReIndex

Recommendation to reindex an existing invalid index.

AnalyzeTable

Recommendation to analyze a table to update statistics for the query optimizer.

VacuumTable

Recommendation to vacuum a table to reclaim storage and optimize performance.

RecommendationTypeParameterEnum

Recommendations list filter. Retrieves recommendations based on type.

Value Description
CreateIndex

Recommendation to create an index to improve query performance.

DropIndex

Recommendation to drop an existing index because it's duplicate or unused.

ReIndex

Recommendation to reindex an existing invalid index.

AnalyzeTable

Recommendation to analyze a table to update statistics for the query optimizer.

VacuumTable

Recommendation to vacuum a table to reclaim storage and optimize performance.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

TuningOptionParameterEnum

The name of the tuning option.

Value Description
index

Index related recommendations.

table

Table related recommendations.