[HACKERS] Re: Postgresql bug report - unexpected behavior ofsuppress_redundant_updates_trigger

Поиск
Список
Период
Сортировка
От J Chapman Flack
Тема [HACKERS] Re: Postgresql bug report - unexpected behavior ofsuppress_redundant_updates_trigger
Дата
Msg-id 3b45ea7f-3434-8d97-9177-f1174131fc9a@math.purdue.edu
обсуждение исходный текст
Ответ на Re: [HACKERS] [BUGS] Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger  (Dilip Kumar <dilipbalaut@gmail.com>)
Ответы Re: [HACKERS] Re: Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 06/19/2017 11:40 AM, Dilip Kumar wrote:
> ... Artus de benque ... wrote:
>> ...=# UPDATE test_table SET field = rpad('', 2001, 'a') WHERE id = 1;
>
> Seems like in "suppress_redundant_updates_trigger"  we are comparing
> toasted tuple with the new tuple and that is the cause of the bug.

Something still puzzles me about this, though, maybe only because
I don't know enough about TOAST.

The size of 'field' ends up 2001, or just over the threshold where
TOASTing will be attempted at all. The report doesn't mention changing
the strategy from the default EXTENDED, so won't the first thing
attempted be compression? Won't that succeed spectacularly, since the
test string is a single character 2001 times, probably producing
a compressed string a handful of bytes long, well under the threshold,
obviating any need to go further with TOAST pointers?

Is the compression algorithm nondeterministic? Is there some way
that compressing the same 2001*'a' on two occasions would produce
compressed strings that don't match?

What exactly is s_r_u_t() comparing, in the case where the TOASTed
value has been compressed, but not out-of-lined?

-Chap



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

Предыдущее
От: Matt Pulver
Дата:
Сообщение: Re: [HACKERS] INSERT ... ON CONFLICT () SELECT
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: [HACKERS] Optional message to user when terminating/cancelling backend