Re: equal() perf tweak

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: equal() perf tweak
Дата
Msg-id 14277.1067871879@sss.pgh.pa.us
обсуждение исходный текст
Ответ на equal() perf tweak  (Neil Conway <neilc@samurai.com>)
Ответы Re: equal() perf tweak  (Neil Conway <neilc@samurai.com>)
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> This code is inefficient, however: length() requires iterating through
> the entire list, so this code scans both lists twice. The attached patch
> improves this by implementing equal() with a single scan of both lists.

You have effectively reverted the code to its previous slow state.

The problem with what you've done is that it recursively applies equal()
to the list contents, which may take a very large number of cycles, only
to eventually fail because one list is a prefix of the other.  The point
of the current coding is to detect that condition before we recurse.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bufmgr code cleanup
Следующее
От: Neil Conway
Дата:
Сообщение: Re: equal() perf tweak