Commit 0cdacb8
committed
fix: use WHERE filter instead of LIMIT for pgss queryid cardinality control
Replace ORDER BY calls DESC LIMIT 100 with:
WHERE calls >= 5 OR exec_time_total >= 1000
This keeps all meaningful queries (both frequent AND rare-but-slow) while
filtering PostgREST noise (one-off queries with <5 calls and <1s total time).
The sample_limit: 5000 in prometheus.yml acts as a safety net if cardinality
is still too high.
https://claude.ai/code/session_01SzJxzZNQjDQphaHyaX3RU71 parent 7d69338 commit 0cdacb8
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | | - | |
1039 | | - | |
| 1038 | + | |
1040 | 1039 | | |
1041 | 1040 | | |
1042 | 1041 | | |
| |||
1083 | 1082 | | |
1084 | 1083 | | |
1085 | 1084 | | |
1086 | | - | |
1087 | | - | |
| 1085 | + | |
1088 | 1086 | | |
1089 | 1087 | | |
1090 | 1088 | | |
| |||
0 commit comments