Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array

Поиск
Список
Период
Сортировка
От Xuneng Zhou
Тема Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
Дата
Msg-id CABPTF7V9gcpTLrOY0fG4YontoHjVg8YrbmiH4XB_5PT6K56xhg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
Список pgsql-hackers
Hi Hackers,

The SnapBuildPurgeOlderTxn function previously used a suboptimal
method to remove old XIDs from the committed.xip array. It allocated a
temporary workspace array, copied the surviving elements into it, and
then copied them back, incurring unnecessary memory allocation and
multiple data copies.

This patch refactors the logic to use a standard two-pointer, in-place
compaction algorithm. The new approach filters the array in a single
pass with no extra memory allocation, improving both CPU and memory
efficiency.

No behavioral changes are expected. This resolves a TODO comment
expecting a more efficient algorithm.

Best,
Xuneng

Вложения

В списке pgsql-hackers по дате отправления: