Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)

Поиск
Список
Период
Сортировка
От Matthias van de Meent
Тема Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)
Дата
Msg-id CAEze2WjOwB_w83=hh0oe=4nhzX+aoEk=MKrSRehFF00zNg412A@mail.gmail.com
обсуждение исходный текст
Ответ на Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
On Mon, 4 Mar 2024 at 18:39, Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> Hi,
>
> The function var_strcmp is a critical function.
> Inside the function, there is a shortcut condition,
> which allows for a quick exit.
>
> Unfortunately, the current code calls a very expensive function beforehand, which if the test was true, all the call
timeis wasted.
 
> So, IMO, it's better to postpone the function call until when it is actually necessary.

Thank you for your contribution.

I agree it would be better, but your current patch is incorrect,
because we need to check if the user has access to the locale (and
throw an error if not) before we return that the two strings are
equal.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech)



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

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)