pgsql: Fix minmax-multi distance for extreme interval values

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема pgsql: Fix minmax-multi distance for extreme interval values
Дата
Msg-id [email protected]
обсуждение исходный текст
Список pgsql-committers
Fix minmax-multi distance for extreme interval values

When calculating distance for interval values, the code mostly mimicked
interval_mi, i.e. it built a new interval value for the difference.
That however does not work for sufficiently distant interval values,
when the difference overflows the interval range.

Instead, we can calculate the distance directly, without constructing
the intermediate (and unnecessary) interval value.

Backpatch to 14, where minmax-multi indexes were introduced.

Reported-by: Dean Rasheed
Reviewed-by: Ashutosh Bapat, Dean Rasheed
Backpatch-through: 14
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c6cf6d353c2865d82356ac86358622a101fde8ca

Modified Files
--------------
src/backend/access/brin/brin_minmax_multi.c | 33 ++++-------------------------
src/test/regress/expected/brin_multi.out    | 29 +++++++++++++++++++++++++
src/test/regress/sql/brin_multi.sql         | 21 ++++++++++++++++++
3 files changed, 54 insertions(+), 29 deletions(-)


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