Updates: all or partial records

Поиск
Список
Период
Сортировка
Искать
От
Paul M Foster
Тема
Updates: all or partial records
Дата
Msg-id
20100125061346.GU3304@quillandmouse.com
Список
Дерево обсуждения
Updates: all or partial records Paul M Foster <paulf@quillandmouse.com>
Re: Updates: all or partial records John R Pierce <pierce@hogranch.com>
Re: Updates: all or partial records Adrian von Bidder <avbidder@fortytwo.ch>
Re: Updates: all or partial records Craig Ringer <craig@postnewspapers.com.au>
Scenario: You have to update a record. One or more fields are unchanged
from the original record being altered. So you have two options: 1)
Include those fields in your UPDATE statement, even though they are
unchanged; 2) Omit unchanged fields from the UPDATE statement.

My first inclination is to omit unchanged fields. However, I have the
idea that PG simply marks the existing record to be dropped, and
generates a whole new row by copying unspecified fields from the
original record.

My question is, which is more efficient? Performance-wise, does it
matter whether unchanged fields are included or omitted on UPDATE
statements?

Paul

-- 
Paul M. Foster
В списке pgsql-general по дате отправления
От: Hashimoto Yuya
Дата:
От: Vincenzo Romano
Дата:
FAQ