Re: pg_rawdump

From: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Aidan Van Dyk <aidan(at)highrise(dot)ca>, Roberto Mello <roberto(dot)mello(at)gmail(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_rawdump
Date: 2010-10-21 07:06:18
Message-ID: 20101021070618.GA12860@cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
>On Wed, Oct 20, 2010 at 5:30 PM, Stephen R. van den Berg <srb(at)cuci(dot)nl> wrote:
>> Ideal would be: put the table-oid inside the header of each page
>> (either in the official header, or in the special area).
>> This way even lost blocks can be correlated to the same table.
>> I'd still vote for the latest known table definition in the first
>> page. ?It's by no means perfect, but it will help 99% of all
>> salvage attempts by an order of magnitude.

> and break on-disk compatibility just to make it easier to

If it's inserted in the "special" area, it will not break any
compatibility.

>I don't think we should shrink the amount of usable space by 4 bytes
>per block

Instead of putting it in every page, it could be inserted (say) once
every megabyte (if done in the special area) to avoid excessive
overhead.

>I'm pretty dubious about the proposal to stuff an otherwise-useless
>metapage in every heap, too.

The information is supposed to go in the special area, so it will not
be an extra page.

> If you have many small tables, you just
>doubled your disk utilization

For small tables, the table description typically is small as well,
so in the common case it all will still fit in one page.

>- worse than that, maybe, if some of
>them are empty.

An empty table does not contain any critical information which needs
to be restored (by definition :-); so the code that inserts the
table definition in the special area could easily be instructed *not*
to write out this information unless the table actually has entries.

> If we needed a metapage anyway and had extra space to
>play with, stuffing some useful forensic information in there might be
>worthwhile, but I have a hard time thinking that forensics alone is a
>sufficient justification for such a change.

The "change" could easily be made backward compatible to all on disk
formats which support the special area pointer (I'm not sure how far
back that is).
--
Stephen.

For children with short attention spans: boomerangs that don't come back.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-10-21 07:33:31 Re: Extensions, this time with a patch
Previous Message Richard Huxton 2010-10-21 06:51:12 Re: Domains versus arrays versus typmods