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

From Lincoln Yeoh
Subject Re: INSERT WHERE NOT EXISTS
Date
Msg-id 5.2.1.1.1.20030627212624.02fa04c8@mbox.jaring.my
Whole thread Raw
In response to Re: INSERT WHERE NOT EXISTS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
At 10:05 AM 6/26/2003 -0400, Tom Lane wrote:

>Lincoln Yeoh <lyeoh@pop.jaring.my> writes:
> > (Related: I also suggested arbitrary user locks years back, but I wasn't
> > able to implement them.)
>
>Don't we have 'em already?  See contrib/userlock/.

Kinda.

The one I was thinking of was locking on an arbitrary string - which would
allows application level insert lock of even finer granularity amongst
other things.

You can then actually lock on stuff you are trying to insert and it won't
block other unrelated inserts.

Now that I think of it, one could achieve something possibly close enough
with the existing userlock, just lock on the first/last/hash 32 bits of the
data you want to insert. Sure some inserts will clash, but it's still
better than blocking all other inserts. The 16 bit group could be for the
tables.

D'oh. Sure took me a long while to realize this... <sheepish grin>.

Link.

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Vacuum (table performance)
Next
From: The Hermit Hacker
Date:
Subject: Re: developers.postgresql.org