Re: INSERT WHERE NOT EXISTS - Mailing list pgsql-general

From Tom Lane
Subject Re: INSERT WHERE NOT EXISTS
Date
Msg-id 15828.1056776639@sss.pgh.pa.us
Whole thread Raw
In response to Re: INSERT WHERE NOT EXISTS  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
Lincoln Yeoh <lyeoh@pop.jaring.my> writes:
> You can use limit. Postgresql is smart enough to stop once it has the
> necessary rows[1].
> [1] Or was it necessary rows + 1? Agh, something wrong with my memory.

7.4 stops at exactly the LIMIT row count.  Several prior releases fetch
one more row internally ... which is hardly noticeable in most contexts,
but sure enough we got complaints ...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Redhat's "enhancements" to PG
Next
From: "Maksim Likharev"
Date:
Subject: tweaking PG and "machine health".