Re: heap-only tuples, and constraints

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: heap-only tuples, and constraints
Дата
Msg-id 1282182509.31353.24.camel@jdavis-ux.asterdata.local
обсуждение исходный текст
Ответ на heap-only tuples, and constraints  ("maxxedit@gmail.com" <maxxedit@gmail.com>)
Список pgsql-general
On Sat, 2010-08-14 at 00:29 -0700, maxxedit@gmail.com wrote:
> Does this statement (UPDATE user SET email='newChangedVal',
> password='existingVal') requires updating an index on user.password?
> Or more generally, if an UPDATE includes an explicit but unchanged
> value for an index column, does postgres need to also update the index
> entries? Or does HOT apply only when indexed column is missing or not
> explicit (i.e. password=password)?

It does a binary comparison of the old/new values (for indexed columns),
and if they are identical, it allows a HOT update.

If a data type has two representations for the same value, that may mean
that it does a regular update when it could do a hot update. In other
words, it doesn't call a datatype-specific equality function.

> Along the same line of thought as above, if password is a foreign key
> column and if an UPDATE includes an explicit but unchanged value for
> this fk column, does postgres need to check constraint satisfiability?

No, it does not need to do the check.

In this case, however, it does appear that it uses a datatype-specific
equality function. So, even if you have a strange datatype where two
equal values can have different representations, it will still avoid the
check.

Regards,
    Jeff Davis


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Massively Parallel transactioning?
Следующее
От: Jeremy Palmer
Дата:
Сообщение: Re: Win32 Backend Cash - pre-existing shared memory block is still in use