diff options
author | Michael Paquier <michael@paquier.xyz> | 2021-01-15 10:33:13 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2021-01-15 10:33:13 +0900 |
commit | 5ae1572993ae8bf1f6c33a933915c07cc9bc0add (patch) | |
tree | 168aed6378d35f24973cba9db39137d5cdfea053 /src/backend/commands/async.c | |
parent | 5e5f4fcd89c082bba0239e8db1552834b4905c34 (diff) | |
download | postgresql-5ae1572993ae8bf1f6c33a933915c07cc9bc0add.tar.gz postgresql-5ae1572993ae8bf1f6c33a933915c07cc9bc0add.zip |
Fix O(N^2) stat() calls when recycling WAL segments
The counter tracking the last segment number recycled was getting
initialized when recycling one single segment, while it should be used
across a full cycle of segments recycled to prevent useless checks
related to entries already recycled.
This performance issue has been introduced by b2a5545, and it was first
implemented in 61b86142.
No backpatch is done per the lack of field complaints.
Reported-by: Andres Freund, Thomas Munro
Author: Michael Paquier
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/20170621211016.eln6cxxp3jrv7m4m@alap3.anarazel.de
Discussion: https://postgr.es/m/CA+hUKG+DRiF9z1_MU4fWq+RfJMxP7zjoptfcmuCFPeO4JM2iVg@mail.gmail.com
Diffstat (limited to 'src/backend/commands/async.c')
0 files changed, 0 insertions, 0 deletions