PostgreSQL statistics

Поиск
Список
Период
Сортировка
От Paulo Silva
Тема PostgreSQL statistics
Дата
Msg-id CAHJdQrk7ycpKYJCUS8suYRF5G0NMzb08agr+Smu1NK5JrKGdxA@mail.gmail.com
обсуждение исходный текст
Ответы Re: PostgreSQL statistics
Список pgsql-general
Hi,

I have a table in a PostgreSQL 11 server that isn't being used a lot.

If I run a manual ANALYSE on it the last_analyse statistic isn't being update (I've waited enough time for it to be updated):

# SELECT * FROM pg_catalog.pg_stat_user_tables WHERE schemaname='s1' and relname='t1';
   relid   |      schemaname      |      relname      | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup | n_mod_since_analyze | last_vacuum |        last_autovacuum        | last_analyze | last_autoanalyze | vacuum_count | autovacuum_count | analyze_count | autoanalyze_count
-----------+----------------------+-------------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------+---------------------+-------------+-------------------------------+--------------+------------------+--------------+------------------+---------------+-------------------
 237177743 | s1 | t1 |        0 |            0 |        0 |             0 |         0 |         0 |         0 |             0 |       4820 |          0 |                   0 |             | 2023-11-03 13:34:23.725802+00 |              |                  |            0 |                1 |             0 |                 0
(1 row)

But if I run a "SELECT * FROM s1.t1"  I see the seq_scan increase to 1 (as expected) and after that I can issue a manual ANALYZE and the last_analyze gets updated.

Is this behaviour normal? Are there some parameters that are verified that prevent the ANALYSE from running?

Regards
--
Paulo Silva <paulojjs@gmail.com>

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

Предыдущее
От: Avi Weinberg
Дата:
Сообщение: Trigger to Count Number of Logical Replication Table Changes.
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: PostgreSQL statistics