Re: CREATE TABLE, load and freezing

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE TABLE, load and freezing
Date: 2008-02-28 09:35:38
Message-ID: 47C6806A.3010505@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2008-02-28 09:45:21 Re: Varlena Type Creation
Previous Message Pavan Deolasee 2008-02-28 09:08:51 CREATE TABLE, load and freezing