Statistics updates is delayed when using `commit and chain`

Поиск
Список
Период
Сортировка
От Lætitia Avrot
Тема Statistics updates is delayed when using `commit and chain`
Дата
Msg-id CAB_COditjdhpZ4j=mZ3YG-uG=bqNtXWcBSAkwEJu3cX1X5myOA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Statistics updates is delayed when using `commit and chain`  (Japin Li <japinli@hotmail.com>)
Список pgsql-bugs
Hello,

With a customer, we found out that when using `commit and chain`, statistics on the table were not updated. Here are the steps to reproduce (My customer saw this on Postgres 13, I confirmed it under current main version):

laetitia=# laetitia=# select n_tup_ins from pg_stat_all_tables where relname = 'test';

 n_tup_ins 

-----------

        17

(1 row)


laetitia=# begin;

BEGIN

laetitia=*# insert into test (value) values ('bla');

INSERT 0 1

laetitia=*# commit and chain;

COMMIT

laetitia=*# select n_tup_ins from pg_stat_all_tables where relname = 'test';

 n_tup_ins 

-----------

        17

(1 row)


laetitia=*# commit;

COMMIT

laetitia=# select n_tup_ins from pg_stat_all_tables where relname = 'test';

 n_tup_ins 

-----------

        18

(1 row)


Before issuing the last `commit`, I used another connection to check the value of the statistics from another transaction and it was not updated:

laetitia=# select n_tup_ins from pg_stat_all_tables where relname = 'test';

 n_tup_ins 

-----------

        17

(1 row)


Maybe it's not a bug and it's on purpose but I can't understand what would prevent the statistics collector from being triggered after a `commti and chain`.

Have a nice day,

Lætitia

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

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: I/O timigns don't include time for temp buffers
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17097: FailedAssertion at initsplan.c