pgsql: Don't reset pg_class.reltuples and relpages in VACUUM, if any

Поиск
Список
Период
Сортировка
От heikki@postgresql.org (Heikki Linnakangas)
Тема pgsql: Don't reset pg_class.reltuples and relpages in VACUUM, if any
Дата
Msg-id 20081217091504.1FD927563FE@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Don't reset pg_class.reltuples and relpages in VACUUM, if any pages were
skipped. We could update relpages anyway, but it seems better to only
update it together with reltuples, because we use the reltuples/relpages
ratio in the planner. Also don't update n_live_tuples in pgstat.

ANALYZE in VACUUM ANALYZE now needs to update pg_class, if the
VACUUM-phase didn't do so. Added some boolean-passing to let analyze_rel
know if it should update pg_class or not.

I also moved the relcache invalidation (to update rd_targblock) from
vac_update_relstats to where RelationTruncate is called, because
vac_update_relstats is not called for partial vacuums anymore. It's more
obvious to send the invalidation close to the truncation that requires it.

Per report by Ned T. Crigler.

Modified Files:
--------------
    pgsql/src/backend/commands:
        analyze.c (r1.129 -> r1.130)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/analyze.c?r1=1.129&r2=1.130)
        vacuum.c (r1.382 -> r1.383)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuum.c?r1=1.382&r2=1.383)
        vacuumlazy.c (r1.113 -> r1.114)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuumlazy.c?r1=1.113&r2=1.114)
    pgsql/src/backend/parser:
        gram.y (r2.643 -> r2.644)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y?r1=2.643&r2=2.644)
    pgsql/src/backend/postmaster:
        pgstat.c (r1.185 -> r1.186)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/pgstat.c?r1=1.185&r2=1.186)
    pgsql/src/include:
        pgstat.h (r1.79 -> r1.80)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/pgstat.h?r1=1.79&r2=1.80)
    pgsql/src/include/commands:
        vacuum.h (r1.81 -> r1.82)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/vacuum.h?r1=1.81&r2=1.82)

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

Предыдущее
От: momjian@postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: The attached patch contains a couple of fixes in the existing
Следующее
От: meskes@postgresql.org (Michael Meskes)
Дата:
Сообщение: pgsql: Applied patch by ITAGAKI Takahiro