Re: Want records to be UNIQUE. When searching for dupes, stop onfirst matching record. - Mailing list pgsql-novice

From Peter Geoghegan
Subject Re: Want records to be UNIQUE. When searching for dupes, stop onfirst matching record.
Date
Msg-id CAH2-WznihtJ20uiCwwx2x-9ax3cpu3XZPhhs4S5xFAWp039RGw@mail.gmail.com
Whole thread Raw
In response to Want records to be UNIQUE. When searching for dupes, stop on firstmatching record.  (Pól Ua Laoínecháin <linehanp@tcd.ie>)
Responses Re: Want records to be UNIQUE. When searching for dupes, stop onfirst matching record.
List pgsql-novice
On Thu, Apr 18, 2019 at 1:15 PM Pól Ua Laoínecháin <linehanp@tcd.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



pgsql-novice by date:

Previous
From: Pól Ua Laoínecháin
Date:
Subject: Re: Want records to be UNIQUE. When searching for dupes, stop onfirst matching record.
Next
From: Pól Ua Laoínecháin
Date:
Subject: Re: Want records to be UNIQUE. When searching for dupes, stop onfirst matching record.