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

feat(azure): enable index tuning for postgres in YT #1455

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { Sku as PostgresSku } from '../modules/postgreSql/create.bicep'

param postgresConfiguration {
sku: PostgresSku
enableIndexTuning: bool
enableQueryPerformanceInsight: bool
}

Expand Down Expand Up @@ -205,6 +206,7 @@ module postgresql '../modules/postgreSql/create.bicep' = {
: secrets.dialogportenPgAdminPassword
sku: postgresConfiguration.sku
appInsightWorkspaceName: appInsights.outputs.appInsightsWorkspaceName
enableIndexTuning: postgresConfiguration.enableIndexTuning
enableQueryPerformanceInsight: postgresConfiguration.enableQueryPerformanceInsight
subnetId: vnet.outputs.postgresqlSubnetId
vnetId: vnet.outputs.virtualNetworkId
Expand Down
1 change: 1 addition & 0 deletions .azure/infrastructure/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ param postgresConfiguration = {
tier: 'GeneralPurpose'
}
enableQueryPerformanceInsight: false
enableIndexTuning: false
}

param redisSku = {
Expand Down
1 change: 1 addition & 0 deletions .azure/infrastructure/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ param postgresConfiguration = {
name: 'Standard_B1ms'
tier: 'Burstable'
}
enableIndexTuning: false
enableQueryPerformanceInsight: true
}

Expand Down
1 change: 1 addition & 0 deletions .azure/infrastructure/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ param postgresConfiguration = {
name: 'Standard_B2s'
tier: 'Burstable'
}
enableIndexTuning: false
enableQueryPerformanceInsight: true
}

Expand Down
1 change: 1 addition & 0 deletions .azure/infrastructure/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ param postgresConfiguration = {
name: 'Standard_D4ads_v5'
tier: 'GeneralPurpose'
}
enableIndexTuning: true
enableQueryPerformanceInsight: true
}

Expand Down
13 changes: 13 additions & 0 deletions .azure/modules/postgreSql/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ param sku Sku
@description('Enable query performance insight')
param enableQueryPerformanceInsight bool

@description('Enable index tuning')
param enableIndexTuning bool

@description('The name of the Application Insights workspace')
param appInsightWorkspaceName string

Expand Down Expand Up @@ -141,6 +144,16 @@ resource pgms_wait_sampling_query_capture_mode 'Microsoft.DBforPostgreSQL/flexib
dependsOn: [pg_qs_query_capture_mode]
}

resource index_tuning_mode 'Microsoft.DBforPostgreSQL/flexibleServers/configurations@2024-08-01' = if (enableIndexTuning) {
parent: postgres
name: 'index_tuning.mode'
properties: {
value: 'report'
source: 'user-override'
}
dependsOn: [pgms_wait_sampling_query_capture_mode]
}

resource appInsightsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' existing = {
name: appInsightWorkspaceName
}
Expand Down
Loading