[COMMITTERS] pgsql: Avoid having vacuum set reltuples to 0 on non-empty relationsin

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема [COMMITTERS] pgsql: Avoid having vacuum set reltuples to 0 on non-empty relationsin
Дата
Msg-id E1coe3P-0001GV-Ts@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: [COMMITTERS] pgsql: Avoid having vacuum set reltuples to 0 onnon-empty relations in  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-committers
Avoid having vacuum set reltuples to 0 on non-empty relations in the
presence of page pins, which leads to serious estimation errors in the
planner.  This particularly affects small heavily-accessed tables,
especially where locking (e.g. from FK constraints) forces frequent
vacuums for mxid cleanup.

Fix by keeping separate track of pages whose live tuples were actually
counted vs. pages that were only scanned for freezing purposes.  Thus,
reltuples can only be set to 0 if all pages of the relation were
actually counted.

Backpatch to all supported versions.

Per bug #14057 from Nicolas Baccelli, analyzed by me.

Discussion: https://postgr.es/m/20160331103739.8956.94469@wrigleys.postgresql.org

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ee78ad5bc0d2b905fdfcee997c76e98292f65fbb

Modified Files
--------------
src/backend/commands/vacuumlazy.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: [COMMITTERS] pgsql: Avoid access to uninitialized memory in shared tidbitmapiterati
Следующее
От: Vik Fearing
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Avoid having vacuum set reltuples to 0 onnon-empty relations in