Re: INSERT WHERE NOT EXISTS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: INSERT WHERE NOT EXISTS
Date: 2003-06-28 05:03:59
Message-ID: 15828.1056776639@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Maksim Likharev 2003-06-28 05:24:06 tweaking PG and "machine health".
Previous Message Tom Lane 2003-06-28 05:00:59 Re: Redhat's "enhancements" to PG