Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Craig Ringer
On 10/02/2014 03:06 AM, Peter Geoghegan wrote: > In my view, it makes sense to fix that, and to make INSERT ... ON > CONFLICT IGNORE work with exclusion constraints. However, it does not > make sense to have INSERT ... ON CONFLICT UPDATE work with exclusion > constraints. The user-visible semantics

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Ants Aasma
On Wed, Oct 1, 2014 at 2:42 PM, Simon Riggs wrote: >> GiST supports exclusion constraints. That is one of the main reasons I want >> to do promise tuples, instead of locking within the indexam: to support this >> feature with exclusion constraints. > > That does sound interesting, but I am concern

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Peter Geoghegan
On Wed, Oct 1, 2014 at 6:49 AM, Heikki Linnakangas wrote: > Well, if nothing else, it would be nice to fix the concurrency issue we have > with exclusion constraints today, which is that if two backends insert the > same value at the same time, they might both get an error, even though you'd > onl

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Peter Geoghegan
On Wed, Oct 1, 2014 at 4:23 AM, Simon Riggs wrote: > Quoting general research and other points about value locking are > reasonable in the general section, but not in the description for 1. I also made a similar comparison of #3. I don't think that reflects a bias. > I'm glad you've called the f

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Heikki Linnakangas
On 10/01/2014 04:46 PM, Simon Riggs wrote: On 1 October 2014 14:31, Simon Riggs wrote: On 1 October 2014 13:43, Heikki Linnakangas wrote: That does sound interesting, but I am concerned the semantics may cause issues. If I go to insert a row for 'UK' and find an existing row for 'Europe', d

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Heikki Linnakangas
On 10/01/2014 04:31 PM, Simon Riggs wrote: On 1 October 2014 13:43, Heikki Linnakangas wrote: That does sound interesting, but I am concerned the semantics may cause issues. If I go to insert a row for 'UK' and find an existing row for 'Europe', do we really want to update the population of E

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Simon Riggs
On 1 October 2014 14:31, Simon Riggs wrote: > On 1 October 2014 13:43, Heikki Linnakangas wrote: > >>> That does sound interesting, but I am concerned the semantics may cause >>> issues. >>> >>> If I go to insert a row for 'UK' and find an existing row for >>> 'Europe', do we really want to updat

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Simon Riggs
On 1 October 2014 13:43, Heikki Linnakangas wrote: >> That does sound interesting, but I am concerned the semantics may cause >> issues. >> >> If I go to insert a row for 'UK' and find an existing row for >> 'Europe', do we really want to update the population of Europe to be >> the population of

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Heikki Linnakangas
On 10/01/2014 02:42 PM, Simon Riggs wrote: On 1 October 2014 11:58, Heikki Linnakangas wrote: On 10/01/2014 01:50 PM, Simon Riggs wrote: On 1 October 2014 10:44, Heikki Linnakangas wrote: I didn't realize that "promise index tuples" were even seriously discussed. I guess that can be made t

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Simon Riggs
On 1 October 2014 11:58, Heikki Linnakangas wrote: > On 10/01/2014 01:50 PM, Simon Riggs wrote: >> >> On 1 October 2014 10:44, Heikki Linnakangas >> wrote: >> >>> I didn't realize that "promise index tuples" were even seriously >>> discussed. >>> I guess that can be made to work, too, although I

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Simon Riggs
On 1 October 2014 09:44, Peter Geoghegan wrote: > In the hope of unblocking things, I have created this Wiki page, which > details the advantages and disadvantages of all 3 approaches that have > been discussed, as suggested by myself and others: > > https://wiki.postgresql.org/wiki/Value_locking

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Heikki Linnakangas
On 10/01/2014 01:50 PM, Simon Riggs wrote: On 1 October 2014 10:44, Heikki Linnakangas wrote: I didn't realize that "promise index tuples" were even seriously discussed. I guess that can be made to work, too, although I don't see the point. It wouldn't work with GiST indexes, for the same reas

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Simon Riggs
On 1 October 2014 10:44, Heikki Linnakangas wrote: > I didn't realize that "promise index tuples" were even seriously discussed. > I guess that can be made to work, too, although I don't see the point. It > wouldn't work with GiST indexes, for the same reasons as page-level locking > won't work (

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Andres Freund
On 2014-10-01 12:44:25 +0300, Heikki Linnakangas wrote: > I didn't realize that "promise index tuples" were even seriously discussed. > I guess that can be made to work, too, although I don't see the point. It > wouldn't work with GiST indexes, for the same reasons as page-level locking > won't wor

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Heikki Linnakangas
On 10/01/2014 11:49 AM, Andres Freund wrote: On 2014-10-01 01:44:04 -0700, Peter Geoghegan wrote: In the hope of unblocking things, I have created this Wiki page, which details the advantages and disadvantages of all 3 approaches that have been discussed, as suggested by myself and others: http

Re: [HACKERS] "Value locking" Wiki page

2014-10-01 Thread Andres Freund
On 2014-10-01 01:44:04 -0700, Peter Geoghegan wrote: > In the hope of unblocking things, I have created this Wiki page, which > details the advantages and disadvantages of all 3 approaches that have > been discussed, as suggested by myself and others: > > https://wiki.postgresql.org/wiki/Value_loc

[HACKERS] "Value locking" Wiki page

2014-10-01 Thread Peter Geoghegan
The current approach to "value locking" remains a controversial aspect of my INSERT ... ON CONFLICT UPDATE patch. I must admit that this is a very complicated area, and it's difficult to keep things straight, particularly with the relevant discussion scattered all over the place. In the hope of un