Re: Some newbie questions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Some newbie questions
Дата
Msg-id 20080908132026.GA4411@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Some newbie questions  (M2Y <mailtoyahoo@gmail.com>)
Список pgsql-hackers
M2Y escribió:

> On Sep 7, 11:52 pm, pgsql@Sheeky.Biz (Shane Ambler) wrote:
> > > What is a good way to start understanding backend(postgres) code? Is
> > > there any documentation available especially for developers?

> > > What is commit log and why it is needed?
> >
> > To achieve ACID (Atomic, Consistent, Isolatable, Durable)
> > The changes needed to complete a transaction are saved to the commit log
> > and flushed to disk, then the data files are changed. If the power goes
> > out during the data file modifications the commit log can be used to
> > complete the changes without losing any data.
> 
> This, I think, is transaction log or XLog. My question is about CLog
> in which two bits are there for each transaction which will denote the
> status of transaction. Since there is XLog from which we can determine
> what changes we have to redo and undo, what is the need for this CLog.

That's correct -- what Shane is describing is the transaction log
(usually know here as WAL).  However, this xlog is write-only (except in
the case of a crash); clog is read-write, and must be fast to query
since it's used very frequently to determine visibility of each tuple.
Perhaps what you need to read is the chapter on our MVCC implementation,
which relies heavily on clog.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Cleanup of GUC units code
Следующее
От: Martin Pihlak
Дата:
Сообщение: Re: reducing statistics write overhead