-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update postgresql parameters for db investigations
- Loading branch information
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4723,4 +4723,15 @@ databaseChangeLog: | |
tag: drop-test_order_id-not_null_constraint-from-result | ||
- dropNotNullConstraint: | ||
tableName: result | ||
columnName: test_order_id | ||
columnName: test_order_id | ||
- changeSet: | ||
id: create-pg-stat-statements-extension | ||
author: [email protected] | ||
comment: Install the pg_stat_statements extension. | ||
changes: | ||
- sql: | ||
sql: CREATE EXTENSION IF NOT EXISTS pg_stat_statements; | ||
rollback: | ||
- sql: | ||
sql: -- DROP EXTENSION IF EXISTS pg_stat_statements; | ||
comment: Dropping the extension requires superuser permissions, and we don't want to give that to the migration user, so we have to do nothing here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# These are disabled by default to avoid performance impact. | ||
|
||
# https://www.postgresql.org/docs/current/runtime-config-logging.html | ||
resource "azurerm_postgresql_flexible_server_configuration" "log_min_duration_statement" { | ||
name = "log_min_duration_statement" | ||
server_id = azurerm_postgresql_flexible_server.db.id | ||
# To enable: this is in milliseconds, update this to a positive value in milliseconds to enable this logging | ||
# To disable: update this to -1 | ||
value = 30 | ||
} | ||
|
||
# https://www.postgresql.org/docs/current/runtime-config-statistics.html | ||
resource "azurerm_postgresql_flexible_server_configuration" "track_io_timing" { | ||
name = "track_io_timing" | ||
server_id = azurerm_postgresql_flexible_server.db.id | ||
# To enable: update this to "on" to enable | ||
# To disable: update this to "off" | ||
value = "on" | ||
} | ||
|
||
# https://www.postgresql.org/docs/current/pgstatstatements.html | ||
resource "azurerm_postgresql_flexible_server_configuration" "pg_stat_statements_track" { | ||
name = "pg_stat_statements.track" | ||
server_id = azurerm_postgresql_flexible_server.db.id | ||
# To enable: update this to "top" or "all" to enable' | ||
# To disable: update this to "none" | ||
value = "all" | ||
} | ||
|
||
# https://www.postgresql.org/docs/current/auto-explain.html | ||
resource "azurerm_postgresql_flexible_server_configuration" "auto_explain_log_analyze" { | ||
name = "auto_explain.log_analyze" | ||
server_id = azurerm_postgresql_flexible_server.db.id | ||
# To enable: update this to "on" to enable | ||
# To disable: update this to "off" | ||
value = "on" | ||
} | ||
|
||
# https://www.postgresql.org/docs/current/auto-explain.html | ||
resource "azurerm_postgresql_flexible_server_configuration" "auto_explain_log_min_duration" { | ||
name = "auto_explain.log_min_duration" | ||
server_id = azurerm_postgresql_flexible_server.db.id | ||
# To enable: this is in milliseconds, update this to a positive value in milliseconds to enable this logging | ||
# To disable: update this to -1 | ||
value = 30 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters