Re: MD5 aggregate

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MD5 aggregate
Дата
Msg-id 9910.1371221245@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MD5 aggregate  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: MD5 aggregate  (Hannu Krosing <hannu@2ndQuadrant.com>)
Список pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On 14 June 2013 14:14, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Personally I'd be a bit inclined to xor the per-row md5's rather than
>> sum them, but that's a small matter.

> But this would be a much riskier thing to do with a single column,
> because if you updated multiple rows in the same way (e.g., UPDATE t
> SET x='foo' WHERE x='bar') then xor'ing the md5's would cancel out if
> there were an even number of matches.

I was implicitly thinking that the sum would be a modulo sum so that the
final result is still the size of an md5 signature.  If that's true,
then leaking bits via carry out is just as bad as xor's deficiencies.
Now, you could certainly make it a non-modulo sum and not lose any
information to carries, if you're willing to do the arithmetic in
NUMERIC and have a variable-width result.  Sounds a bit slow though.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Patch for fail-back without fresh backup
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: MD5 aggregate