Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0
От | Heikki Linnakangas |
---|---|
Тема | Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0 |
Дата | |
Msg-id | 552FBA1C.5080201@iki.fi обсуждение исходный текст |
Ответ на | Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0 (Andres Freund <andres@anarazel.de>) |
Список | pgsql-hackers |
On 04/16/2015 12:18 PM, Andres Freund wrote: > On 2015-04-15 18:53:15 +0300, Heikki Linnakangas wrote: >> Hmm, ok, I've read the "INSERT ... ON CONFLICT UPDATE and logical decoding" >> thread now, and I have to say that IMHO it's a lot more sane to handle this >> in ReorderBufferCommit() like Peter first did, than to make the main >> insertion path more complex like this. > > I don't like Peter's way much. For one it's just broken. For another > it's quite annoying to trigger disk reads to figure out what actual type > of record something is. > > If we go that way that's the way I think it should be done: Whenever we > encounter a speculative record we 'unlink' it from the changes that will > be reused for spooling from disk and do nothing further. Then we just > continue reading through the records. If the next thing we encounter is > a super-deletion we throw away that record. If it's another type of > change (or even bettter a 'speculative insertion succeeded' record) > insert it. That'll still require some uglyness, but it should not be too > bad. Sounds good to me. - Heikki
В списке pgsql-hackers по дате отправления: