Re: MD5 aggregate

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MD5 aggregate
Дата
Msg-id 8110.1371215672@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MD5 aggregate  (Marko Kreen <markokr@gmail.com>)
Ответы Re: MD5 aggregate  (Benedikt Grundmann <bgrundmann@janestreet.com>)
Re: MD5 aggregate  (Stephen Frost <sfrost@snowman.net>)
Re: MD5 aggregate  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
Marko Kreen <markokr@gmail.com> writes:
> On Thu, Jun 13, 2013 at 12:35 PM, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>> Attached is a patch implementing a new aggregate function md5_agg() to
>> compute the aggregate MD5 sum across a number of rows.

> It's more efficient to calculate per-row md5, and then sum() them.
> This avoids the need for ORDER BY.

Good point.  The aggregate md5 function also fails to distinguish the
case where we have 'xyzzy' followed by 'xyz' in two adjacent rows
from the case where they contain 'xyz' followed by 'zyxyz'.

Now, as against that, you lose any sensitivity to the ordering of the
values.

Personally I'd be a bit inclined to xor the per-row md5's rather than
sum them, but that's a small matter.
        regards, tom lane



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

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