postgres/contrib/intarray
John Naylor 53d3daa491 Specialize intarray sorting
There is at least one report in the field of storing millions of
integers in arrays, so it seems like a good time to specialize
intarray's qsort function. In doing so, streamline the comparators:
Previously there were three, two for each direction for sorting
and one passed to qunique_arg. To preserve the early exit in the
case of descending input, pass the direction as an argument to
the comparator. This requires giving up duplicate detection, which
previously allowed skipping the qunique_arg() call. Testing showed
no regressions this way.

In passing, get rid of nearby checks that the input has at least
two elements, since preserving them would make some macros less
readable. These are not necessary for correctness, and seem like
premature optimizations.

Author: Andrey M. Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/098A3E67-E4A6-4086-9C66-B1EAEB1DFE1C@yandex-team.ru
2025-02-18 11:04:55 +07:00
..
bench Update copyright for 2025 2025-01-01 11:21:55 -05:00
data Fix integer-overflow problem in intarray's g_int_decompress(). 2024-01-07 15:19:50 -05:00
expected Fix integer-overflow problem in intarray's g_int_decompress(). 2024-01-07 15:19:50 -05:00
sql Fix integer-overflow problem in intarray's g_int_decompress(). 2024-01-07 15:19:50 -05:00
_int_bool.c Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
_int_gin.c
_int_gist.c Fix integer-overflow problem in intarray's g_int_decompress(). 2024-01-07 15:19:50 -05:00
_int_op.c
_int_selfuncs.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
_int_tool.c Specialize intarray sorting 2025-02-18 11:04:55 +07:00
_int.h Specialize intarray sorting 2025-02-18 11:04:55 +07:00
_intbig_gist.c Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
.gitignore
intarray--1.1--1.2.sql
intarray--1.2--1.3.sql
intarray--1.2.sql
intarray--1.3--1.4.sql
intarray--1.4--1.5.sql Remove deprecated containment operators for contrib types. 2021-03-05 10:45:41 -05:00
intarray--1.0--1.1.sql
intarray.control Remove deprecated containment operators for contrib types. 2021-03-05 10:45:41 -05:00
Makefile Remove deprecated containment operators for contrib types. 2021-03-05 10:45:41 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00