Faster `&&` intersection for sorted arrays

From: Adrian Garcia Badaracco <adrian(at)adriangb(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Faster `&&` intersection for sorted arrays
Date: 2024-09-28 15:49:47
Message-ID: CAE8z92HXNko026zBe++fXr7_1tDCfFEJyiuUEmppYvUD253U8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was wondering if I could do better than `&&` for sorted arrays by doing
binary search and came up with some really interesting results.
I only did a quick spin of this, an LLM generated most of the code after I
gave it the algorithm and I don't plan on using it in production (I'm going
to normalize my schema instead) but I wanted to share this in case it's
useful to anyone.

https://gist.github.com/adriangb/1b68bb2e408423ddcb90fb0136a00ba8

Browse pgsql-general by date

  From Date Subject
Next Message Lok P 2024-09-28 15:56:05 Re: Grants not working on partitions
Previous Message Adrian Klaver 2024-09-28 15:16:06 Re: Grants not working on partitions