On Thu, Apr 18, 2019 at 1:15 PM Pól Ua Laoínecháin <linehanp(at)tcd(dot)ie> wrote:
> But what I really want (what I really, really want - apologies to the
> Spice Girls) to know is, is there a query which will run and stop on
> the first match? Using ANY, ALL or EXISTS or some construct like that?
It sounds like you're looking for a loose index scan:
https://wiki.postgresql.org/wiki/Loose_indexscan
Unfortunately, Postgres doesn't have this capability just yet, so
you'll have to simulate it in the manner described by the Wiki page.
--
Peter Geoghegan