Zpomalujici se Pg

Honza Pazdziora adelton na informatics.muni.cz
Úterý Listopad 5 10:19:42 CET 2002


On Tue, Nov 05, 2002 at 10:15:21AM +0100, Karel Zak wrote:
> 
>  rychlejsi a hlavne to nevyzaduje vubec zadny zamek). Je treba neustale 
>  myslet na to, ze tech transakci tam muze byt nekolik najednou, takze 
>  prepisovani starych dat neni tak jednoduche.

Ale ty verze jsou vzdycky jenom dve, ne? Commitnuta data, ktera tam
byla predtim, nez transakce zacaly, a pak zmenena data od te jedne
transakce. Ta druha transakce nemuze ta data zmenit, dokud ta prvni
neudela commit nebo rollback.

> Briefly, WAL's central concept is that changes to data files (where tables and
> indexes reside) must be written only after those changes have been logged -
> that is, when log records have been flushed to permanent storage. When we
> follow this procedure, we do not need to flush data pages to disk on every
> transaction commit, because we know that in the event of a crash we will be
> able to recover the database using the log: any changes that have not been
> applied to the data pages will first be redone from the log records (this is
> roll-forward recovery, also known as REDO) and then changes made by uncommitted
> transactions will be removed from the data pages (roll-backward recovery -
> UNDO). 
> 
>  The first obvious benefit of using WAL is a significantly reduced number of
> disk writes, since only the log file needs to be flushed to disk at the time of
> transaction commit; in multiuser environments, commits of many transactions may
> be accomplished with a single fsync() of the log file. Furthermore, the log
> file is written sequentially, and so the cost of syncing the log is much less
> than the cost of flushing the data pages. 

Znamena to, ze bez ohledu na to fflushovaci nastaveni, se ten WAL
fflushuje vzdy (ocekaval bych)?

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton na fi.muni.cz | http://www.fi.muni.cz/~adelton/
      ... all of these signs saying sorry but we're closed ...
------------------------------------------------------------------------


Další informace o konferenci Databases