Re: Statistics visibility in SERIALIZABLE transactions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Statistics visibility in SERIALIZABLE transactions
Дата
Msg-id 23237.1164003176@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Statistics visibility in SERIALIZABLE transactions  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: Statistics visibility in SERIALIZABLE transactions  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
Michael Fuhr <mike@fuhr.org> writes:
> Updates to planner statistics appear to be visible in SERIALIZABLE
> transactions even though updated data is not.  Is this intentional?

This is because the planner uses the catcache to read pg_statistic, and
that runs on SnapshotNow rules.  I am not excited about it: as a general
rule you want to be using the latest stats available.  It is much more
likely that the stats existing at the start of your transaction are
out-of-date than that they are a better representation of the data in
your snapshot than stats committed a bit later.  It's an approximation
either way...

(Actually, in general catalog changes apply immediately even in
SERIALIZABLE mode.  Try looking at a table that was ALTERed since
your transaction began.)
        regards, tom lane


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

Предыдущее
От: "Brendan Jurd"
Дата:
Сообщение: psql: present working directory
Следующее
От: Tom Lane
Дата:
Сообщение: Re: psql: present working directory