Re: Create and drop temp table in 8.3.4

От: Aidan Van Dyk
Тема: Re: Create and drop temp table in 8.3.4
Дата: ,
Msg-id: 20081111150753.GA31053@yugib.highrise.ca
(см: обсуждение, исходный текст)
Ответ на: Re: Create and drop temp table in 8.3.4  ("Joshua D. Drake")
Список: pgsql-performance

Скрыть дерево обсуждения

Create and drop temp table in 8.3.4  ("Kevin Grittner", )
 Re: Create and drop temp table in 8.3.4  ("Kevin Grittner", )
 Re: Create and drop temp table in 8.3.4  ("Kevin Grittner", )
  Re: Create and drop temp table in 8.3.4  ("Kevin Grittner", )
   Re: Create and drop temp table in 8.3.4  ("Joshua D. Drake", )
    Re: Create and drop temp table in 8.3.4  ("Kevin Grittner", )
     Re: Create and drop temp table in 8.3.4  ("Scott Carey", )
      Re: Create and drop temp table in 8.3.4  ("Kevin Grittner", )
      Re: Create and drop temp table in 8.3.4  ("Scott Marlowe", )
       Re: Create and drop temp table in 8.3.4  ("Kevin Grittner", )
        Re: Create and drop temp table in 8.3.4  ("Scott Marlowe", )
         Re: Create and drop temp table in 8.3.4  ("Kevin Grittner", )
          Re: Create and drop temp table in 8.3.4  ("Scott Marlowe", )
           Re: Create and drop temp table in 8.3.4  ("David Rees", )
           Re: Create and drop temp table in 8.3.4  (Matthew Wakeling, )
    Re: Create and drop temp table in 8.3.4  (Aidan Van Dyk, )
 Re: Create and drop temp table in 8.3.4  (Tom Lane, )

Seems like this didn't make it through to the list the first time...

* Aidan Van Dyk <> [081106 22:19]:
> * David Rees <> [081106 21:22]:
>
> > 2. A write barrier instructs the lower level hardware that commands
> > issued before the barrier must be written to disk before commands
> > issued after the barrier. Write barriers are used to ensure that data
> > written to disk is written in such a way as to maintain filesystem
> > consistency, without losing all the benefits of a write cache.
> >
> > 3. A fsync call forces data to be synced to the controller.
> >
> > This means that whenever you call fsync, at the very minimum, the data
> > will have made it to the controller. How much further down the line
> > will depend on whether or not the controller is in WriteBack or
> > WriteThrough mode and whether or not the disk is also caching writes.
> >
> > So in your example, if the OS is caching some writes and fsync is
> > called, it won't be returned until at a minimum the controller has
> > accepted all the data, regardless of whether or not write barriers are
> > enabled.
> >
> > In theory, it should be safe to disable write barriers if you have a
> > BBU because the BBU should guarantee that all writes will eventually
> > make it to disk (or at least reduce the risk of that not happening to
> > an acceptable level).
>
> All that's "correct", but note that fsync doesn't guarentee *coherent*
> filesystem state has been made to controller.  And fsync *can* carry "later"
> writes to the controller.
>
> I belive the particular case the prompted the write-barriers to become default
> was ext3 + journals, where in certain (rare) cases, upon recovery, things were
> out of sync.  What was happening was that ext3 was syncing the journal, but
> "extra" writes were getting carried to the controller during the sync
> operation, and if something crashed at the right time, "new" data was on the
> disk where the "old journal" (because the new journal hadn't finished making
> it to the controller) didn't expect it.
>
> The write barriers give the FS the symantics to say "all previous queue
> writes" [BARRIER] flush to controller [BARRIER] "any new writes", and thus
> guarentee the ordering of certian operations to disk, and guarentee coherency
> of the FS at all times.
>
> Of course, that guarenteed FS consistency comes at a cost.  As to it's
> necessity with the way PG uses the FS w/ WAL....  or it's necessity with
> xfs...
>
> a.
>
> --
> Aidan Van Dyk                                             Create like a god,
>                                        command like a king,
> http://www.highrise.ca/                                   work like a slave.



--
Aidan Van Dyk                                             Create like a god,
                                       command like a king,
http://www.highrise.ca/                                   work like a slave.

Вложения

В списке pgsql-performance по дате сообщения:

От: Tomas Vondra
Дата:
Сообщение: Re: Using index for IS NULL query
От: Jim 'Decibel!' Nasby
Дата:
Сообщение: Re: Oddity with view (now with test case)