增加数据库慢查询观测与索引防线并收窄打手拼单分页查询

This commit is contained in:
yml2213
2026-08-22 18:40:11 +08:00
parent 0dfe363d35
commit 1b8e02dd17
16 changed files with 221 additions and 7 deletions
+11
View File
@@ -7,6 +7,17 @@ x-json-log-rotation: &json-log-rotation
services:
postgres:
image: docker.m.daocloud.io/library/postgres:16-bookworm
# 开启 pg_stat_statements,便于定位生产环境累计最耗时的 SQL。
command:
[
"postgres",
"-c",
"shared_preload_libraries=pg_stat_statements",
"-c",
"pg_stat_statements.track=all",
"-c",
"log_min_duration_statement=${POSTGRES_LOG_MIN_DURATION_STATEMENT_MS:-500}",
]
restart: unless-stopped
logging: *json-log-rotation
environment: