On 13.08.2019 11:27, Craig Ringer wrote:
On 13.08.2019 8:34, Craig Ringer wrote:
But Postgres is not storing this information now anywhere else except statistic, isn't it?
not only - critical numbers are reltuples, relpages from pg_class
That's a very good point. relallvisible too. How's the global temp table impl handling that right now, since you won't be changing the pg_class row? AFAICS relpages doesn't need to be up to date (and reltuples certainly doesn't) so presumably you're just leaving them as zero?
As far as I understand relpages and reltuples are set only when you perform "analyze" of the table.
Also autovacuum's autoanalyze.
When it happen?
I have created normal table, populated it with some data and then wait several hours but pg_class was not updated for this table.
I attach to this mail slightly refactored versions of this patches with fixes of issues reported in your review.
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company