On Mon, Dec 16, 2024 at 12:58 AM Andrey M. Borodin <x4...@yandex-team.ru> wrote: > > > On 11 Dec 2024, at 11:39, John Naylor <johncnaylo...@gmail.com> wrote:
> > Also, I was hoping get an answer for how this would actually affect > > intarray use you've seen in the wild. If the answer is "I don't know > > of any one who uses this either", then I'm actually starting to wonder > > if the speed matters at all. Maybe all uses are for a few hundred or > > thousand integers, in which case the sort time is trivial anyway? > > I do not have access to user data in most clusters... I remember only one > particular case: tags and folders applied to mail messages are represented by > int array. Mostly for GIN search. In that case vast majority of these arrays > are 0-10 elements, some hot-acceses fraction of 10-1000. Only robots (service > accounts) can have millions, and in their case latency have no impact at all. > But this particular case also does not trigger sorting much: arrays are > stored sorted and modifications are infrequent. In most cases sorting is > invoked for already sorted or almost sorted input. Okay, if one case uses millions, than surely others also do so. > So yeah, from practical point of view cosmetic reasons seems to be most > important :) Seems worth doing. -- John Naylor Amazon Web Services