Re: Performance and WAL on big inserts/updates

Поиск
Список
Период
Сортировка
От Sailesh Krishnamurthy
Тема Re: Performance and WAL on big inserts/updates
Дата
Msg-id mjqoer3nhur.fsf@cs.berkeley.edu
обсуждение исходный текст
Ответ на Performance and WAL on big inserts/updates  (Marty Scholes <marty@outputservices.com>)
Список pgsql-hackers
>>>>> "Marty" == Marty Scholes <marty@outputservices.com> writes:
   Marty> Why have I not seen this in any database?   Marty> There must be a reason.

For ARIES-style systems, logging parsed statements (commonly called
"logical" logging) is not preferred compared to logging data items
("physical" or "physiological" logging). 

A major reason for this is that logical logs make recovery contingent
on being able to execute the "parsed statements". This execution
might, however, not be possible if the system is itself not in a
consistent state .. as is normally the case during recovery. 

What if, for instance, it's the catalog tables that were hosed when
the system went down ? It may be difficult to execute the parsed
statements without the catalogs. 

For this reason, a major goal of ARIES was to have each and every data
object (tables/indexes) individually recoverable. So ARIES follows
page-oriented redo logging.

Having said that, page-oriented undo logging can be a pain when B-tree
pages split. For higher concurrency, ARIES uses logical undo
logging. In this case, the logs are akin to your "parsed statement"
idea.

In any case, the only place that parsed statements are useful, imo are
with searched updates that cause a large number of records to change
and with "insert into from select" statements.

Then, there is also the case that this, the "parsed statements"
approach, is not a general solution. How would you handle the "update
current of cursor" scenarios ? In this case, there is some application
logic that determines the precise records that change and how they
change. 

Ergo, it is my claim that while logical redo logging does have some
benefits, it is not a viable general solution.

-- 
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh




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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: Performance and WAL on big inserts/updates
Следующее
От: Tom Lane
Дата:
Сообщение: Re: unsafe floats