RE: [HACKERS] tables > 1 gig - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject RE: [HACKERS] tables > 1 gig
Date
Msg-id 001001beb93e$a6c6a620$2801007e@cadzone.tpf.co.jp
Whole thread Raw
In response to Re: [HACKERS] tables > 1 gig  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] tables > 1 gig
List pgsql-hackers
> > >
> > > How about my idea of creating a truncated file, the renaming it to the
> > > table file.  That keeps the table open for other open file
> descriptors,
> > > but put a zero-length file in place in an atomic manner.
> > >
> >
> > Sorry,I couldn't understand what you mean.
> > What is differenct from truncating existent files to zero length ?
>
> Glad to explain.  Here is the pseudocode:
>
>     create temp file, make it zero length, call it 'zz'
>     rename(zz,tablename)
>
> What this does is to create a zero length file, and the rename unlinks
> the tablename file, and puts the zero-length file in it's place.
> rename() is atomic, so there is no time that the table file does not
> exist.
>

Leti1 be the inode of zzi2 be the inode of tablename
before rename().

Does this mean
   New backends read/write i1 inode and   backends that have the table open read/write i2 inode ?

If so,it seems wrong.
All backends should see same data.

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] tables > 1 gig
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] tables > 1 gig