Re: Is full-row updates slower than single-value updates

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Is full-row updates slower than single-value updates
Дата
Msg-id 28217.1278025271@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Is full-row updates slower than single-value updates  (Björn Lindqvist <bjourne@gmail.com>)
Список pgsql-general
=?ISO-8859-1?Q?Bj=F6rn_Lindqvist?= <bjourne@gmail.com> writes:
> Den 28 juni 2010 20.22 skrev Tom Lane <tgl@sss.pgh.pa.us>:
>> But assigning a new value to a column costs something, even if it
>> happens to be equal to the previous value.

> But do I really need to worry about the cost of casting strings to
> ints and other such parsing operations?

Integers?  Maybe not.  Timestamps?  Probably you ought to think about
it.  Strings long enough to need toasting?  Definitely.

> No column in the table is a toast column, although there are a few
> string columns with quite long urls. If they are indexed, does
> updating them with the same data trigger index updates?

It shouldn't ordinarily, but if the data is long enough to get toasted
then updates are going to happen anyway, both in the toast table and
the main table.

The long and the short of it here is that being lazy is going to cost
you eventually.  Maybe it's all right in a single small application
where you can be confident about what sort of data will be stored, but
an allegedly general-purpose ORM should *not* be making that sort of
assumption.

            regards, tom lane

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: problems with encoding and accent letters
Следующее
От: Dennis Gearon
Дата:
Сообщение: different language indexes