pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix minmax-multi distance for extreme interval values 4+ messages / 1 participants [nested] [flat]
* pgsql: Fix minmax-multi distance for extreme interval values @ 2023-10-27 16:57 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Tomas Vondra @ 2023-10-27 16:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/eef0ea8c-4aaa-8d0d-027f-58b1f35dd170@enterprisedb.com 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix minmax-multi distance for extreme interval values @ 2023-10-27 16:58 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Tomas Vondra @ 2023-10-27 16:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/eef0ea8c-4aaa-8d0d-027f-58b1f35dd170@enterprisedb.com Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/924e0e2ee058d8dfeae6218dba9419a3ddf1c755 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix minmax-multi distance for extreme interval values @ 2023-10-27 16:59 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Tomas Vondra @ 2023-10-27 16:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/eef0ea8c-4aaa-8d0d-027f-58b1f35dd170@enterprisedb.com Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2fbb2fcb0c63d6254aa93a1181a263df07e5c26d 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix minmax-multi distance for extreme interval values @ 2023-10-27 16:59 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Tomas Vondra @ 2023-10-27 16:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/eef0ea8c-4aaa-8d0d-027f-58b1f35dd170@enterprisedb.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0fa73c5cd05093236cd6d5ff56e0bd5693d2645f 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(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2023-10-27 16:59 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-10-27 16:57 pgsql: Fix minmax-multi distance for extreme interval values Tomas Vondra <tomas.vondra@postgresql.org> 2023-10-27 16:58 pgsql: Fix minmax-multi distance for extreme interval values Tomas Vondra <tomas.vondra@postgresql.org> 2023-10-27 16:59 pgsql: Fix minmax-multi distance for extreme interval values Tomas Vondra <tomas.vondra@postgresql.org> 2023-10-27 16:59 pgsql: Fix minmax-multi distance for extreme interval values Tomas Vondra <tomas.vondra@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox