Re: Exposing the stats snapshot timestamp to SQL
От | Tom Lane |
---|---|
Тема | Re: Exposing the stats snapshot timestamp to SQL |
Дата | |
Msg-id | 32122.1424400567@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Exposing the stats snapshot timestamp to SQL (Tomas Vondra <tomas.vondra@2ndquadrant.com>) |
Список | pgsql-hackers |
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes: > Well, the patch also does this: > *** 28,34 **** SELECT pg_sleep_for('2 seconds'); > CREATE TEMP TABLE prevstats AS > SELECT t.seq_scan, t.seq_tup_read, t.idx_scan, t.idx_tup_fetch, > (b.heap_blks_read + b.heap_blks_hit) AS heap_blks, > ! (b.idx_blks_read + b.idx_blks_hit) AS idx_blks > FROM pg_catalog.pg_stat_user_tables AS t, > pg_catalog.pg_statio_user_tables AS b > WHERE t.relname='tenk2' AND b.relname='tenk2'; > --- 28,35 ---- > CREATE TEMP TABLE prevstats AS > SELECT t.seq_scan, t.seq_tup_read, t.idx_scan, t.idx_tup_fetch, > (b.heap_blks_read + b.heap_blks_hit) AS heap_blks, > ! (b.idx_blks_read + b.idx_blks_hit) AS idx_blks, > ! pg_stat_snapshot_timestamp() as snap_ts > FROM pg_catalog.pg_stat_user_tables AS t, > pg_catalog.pg_statio_user_tables AS b > WHERE t.relname='tenk2' AND b.relname='tenk2'; > *************** That's merely a regression test to verify that the value appears to advance from time to time ... I don't think it has any larger meaning. (It will be interesting to see what this new test query reports in the transient buildfarm failures we still occasionally see in the stats test.) regards, tom lane
В списке pgsql-hackers по дате отправления: