Pavan Deolasee wrote:
> In a typical scenario, user might create a table and load data in the
> table as part of a single transaction (e.g pg_restore). In this case,
> it would help if we create the tuples in the *frozen* state to avoid
> any wrap-around related issues with the table. Without this, very
> large read-only tables would require one round of complete freezing
> if there are lot of transactional activities in the other parts of
> the database. And when that happens, it would generate lots of
> unnecessary IOs on these large tables.
If that works, then we might also want to set the visibility hint bits.
Not because lookup of that information is expensive - the tuples all
came from the same transaction, virtually guaranteeing that the relevent
pg_clog page stays in memory after the first few pages.
But by setting them immediatly we'd save some IO, since we won't dirty
all pages during the first scan.
> I don't know if this is a real problem for anybody, but I could think
> of its use case, at least in theory.
A cannot speak for freeze-on-restore, but in a project I'm currently
working on, the IO caused (I guess) by hint-bit updates during the
first scan of the table is at least noticeably...
regards, Florian Pflug