နားလည်ထားရမယ့် အချက်
Incident အချိန်မှာ random index/config changes မလုပ်ဘဲ symptom၊ scope၊ recent changes နဲ့ safe evidence ကိုအရင်စုရပါတယ်။ Slow query plan၊ active sessions၊ blockers၊ table stats နဲ့ resource saturation ကိုကြည့်ပြီး mitigation နှင့် root fix ကိုခွဲပါ။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Catalog endpoint p95 တက်လာသော scenario တွင် read-only diagnostic queries run၊ long transaction terminate လုပ်ရန် approval path၊ missing index test နှင့် rollback criteria ပါသော timeline ရေးမယ်။ Sensitive query text/parameters ကို incident notes ထဲမဖော်ရန်လည်းထည့်ပါ။
အတူတူ စမ်းရေးကြည့်မယ်
SELECT pid, usename, state, wait_event_type, wait_event,
now() - query_start AS running_for,
left(query, 120) AS query_sample
FROM pg_stat_activity
WHERE datname = current_database()
ORDER BY query_start;
SELECT relname, seq_scan, idx_scan, n_live_tup, n_dead_tup
FROM pg_stat_user_tables
WHERE schemaname = 'app'
ORDER BY seq_scan DESC;Evidence၊ mitigation၊ root-cause hypothesis နှင့် rollback ပါသော incident report ရမည်။၅ မိနစ် စမ်းကြည့်
Connection pool saturation အတွက် metric သုံးခု၊ alert threshold နှစ်ခုနှင့် safe mitigation သုံးဆင့်ရေးပါ။
သတိလေးတစ်ချက်
Production မှာ `pg_terminate_backend` ကို blocker မသေချာဘဲ run လုပ်ခြင်းက user transaction ကိုဖျက်နိုင်ပါတယ်။
PostgreSQL — Monitoring Database Activity — PostgreSQL Global Development Group