Re: 'infinity'::Interval should be added

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 'infinity'::Interval should be added
Дата
Msg-id 26567.1544904157@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 'infinity'::Interval should be added  (Andres Freund <andres@anarazel.de>)
Ответы Re: 'infinity'::Interval should be added  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2018-12-15 14:43:49 -0500, Tom Lane wrote:
>> Note that timestamp_lt etc don't actually need any special case for
>> infinity, and we could hope that the infinity representation for interval
>> makes it possible to likewise not special-case it in interval comparisons.
>> But I think it's silly to argue that infinity handling is a significant
>> fraction of something like timestamp_pl_interval or timestamp_part.

> I'm inclined to agree that if done carefully the overhead here is
> probably acceptable.

Backing up to look at the actual code ... if the infinity representation
is the max or min value in each of the three fields, then the conversion
done by interval_cmp_value would yield an int128 value that's certainly
greater than or less than any other interval value, and I don't think it
can overflow, so there's no need to add any code to the comparison cases.

            regards, tom lane


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: 'infinity'::Interval should be added
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Computing the conflict xid for index page-level-vacuum on primary