From:
Noah Misch <noah(at)leadboat(dot)com>
To:
Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
Cc:
Simon Riggs <simon(at)2ndQuadrant(dot)com>,Alvaro Herrera <alvherre(at)commandprompt(dot)com>,Robert Haas <robertmhaas(at)gmail(dot)com>,Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject:
Re: foreign key locks, 2nd attempt
Date:
2012-02-23 21:12:35
Message-ID:
20120223211235.GA9520@tornado.leadboat.com (view raw or flat )
Thread:
2011-11-03 18:12:49 from Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
2011-11-06 07:28:52 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2011-11-10 20:17:59 from Christopher Browne <cbbrowne(at)gmail(dot)com>
2011-11-10 20:21:39 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-10 20:29:44 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2011-11-10 20:38:41 from Christopher Browne <cbbrowne(at)gmail(dot)com>
2011-11-11 17:30:18 from David Kerr <dmk(at)mr-paradox(dot)net>
2011-11-12 04:21:10 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2011-11-19 09:21:41 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2011-11-10 19:59:20 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-11-10 21:09:12 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-11-10 21:19:59 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-11-11 22:02:00 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-11-19 09:21:51 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2011-11-19 15:36:48 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-11-21 17:09:06 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-11-21 20:26:55 from Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
2011-12-04 12:20:27 from Noah Misch <noah(at)leadboat(dot)com>
2011-12-12 20:20:39 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-12 21:03:37 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-13 14:44:49 from Noah Misch <noah(at)leadboat(dot)com>
2011-12-13 16:09:46 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-13 16:20:10 from Noah Misch <noah(at)leadboat(dot)com>
2011-12-13 21:36:21 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-14 15:21:29 from Noah Misch <noah(at)leadboat(dot)com>
2011-12-14 15:36:54 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-12-16 13:37:16 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-02-23 14:15:45 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-23 15:04:14 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 15:12:13 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-23 15:49:02 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 15:28:20 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-02-23 16:01:33 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 16:31:36 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2012-02-23 17:45:45 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 18:44:50 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2012-02-25 01:06:49 from Vik Reykja <vikreykja(at)gmail(dot)com>
2012-02-25 18:06:38 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2012-02-23 18:41:21 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-27 02:47:50 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-05 18:28:59 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-05 18:37:53 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-05 19:34:10 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-05 19:53:37 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-05 20:35:15 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-06 19:58:22 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-06 19:39:32 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-06 20:28:12 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-17 23:11:57 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-06 21:10:16 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-06 21:27:51 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-06 21:40:51 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-07 09:24:11 from Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
2012-03-07 10:02:43 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-07 10:18:26 from Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
2012-03-07 11:11:06 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-07 11:37:01 from Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
2012-03-07 12:16:22 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-06 21:33:13 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-17 23:01:51 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-13 17:00:52 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-13 17:35:02 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-16 03:04:06 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-16 03:08:29 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-16 13:36:11 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-16 13:40:01 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-16 18:15:11 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-17 22:58:41 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-12 17:28:11 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-12 17:50:11 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-12 18:14:33 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-12 19:28:21 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2012-03-13 17:46:24 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-14 03:42:26 from Noah Misch <noah(at)leadboat(dot)com>
2012-03-14 17:23:14 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-14 22:10:00 from Noah Misch <noah(at)leadboat(dot)com>
2012-03-15 01:17:33 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-15 02:26:53 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-15 21:38:53 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 21:54:32 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-15 22:04:41 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 22:13:45 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-15 22:23:32 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 21:46:44 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 21:55:05 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-17 22:45:20 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-25 08:17:59 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-04-05 18:50:58 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-03-15 02:15:22 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-15 21:20:38 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 21:07:28 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-16 00:37:36 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-16 00:53:05 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-16 01:52:12 from Noah Misch <noah(at)leadboat(dot)com>
2012-03-16 03:09:52 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-16 14:08:07 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-16 18:22:05 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-16 18:49:03 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-13 01:24:40 from Noah Misch <noah(at)leadboat(dot)com>
2012-03-13 17:09:57 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-02-27 12:13:32 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2012-02-28 00:28:14 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-28 07:55:31 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-01-15 04:49:54 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-16 19:17:42 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2012-01-16 19:52:36 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-17 06:21:28 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2012-01-18 20:18:31 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-19 02:11:35 from Noah Misch <noah(at)leadboat(dot)com>
2012-01-17 09:56:04 from Noah Misch <noah(at)leadboat(dot)com>
2012-01-17 09:39:13 from Noah Misch <noah(at)leadboat(dot)com>
2012-01-24 18:47:16 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-26 19:03:02 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-27 23:47:27 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-30 23:48:47 from Noah Misch <noah(at)leadboat(dot)com>
2012-01-31 13:17:40 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-01-31 14:19:57 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-31 16:18:30 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-01-31 16:58:21 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-31 17:12:10 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-01-31 23:55:19 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-13 22:16:58 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-22 17:00:07 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-23 09:18:57 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-23 13:08:28 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2012-02-23 14:21:39 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-23 21:12:35 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-24 09:38:52 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2012-02-23 15:43:11 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 17:48:13 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-02-23 18:04:26 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 18:30:09 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-02-24 04:53:34 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-23 21:36:42 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 23:57:47 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-02 00:33:47 from Jim Nasby <jim(at)nasby(dot)net>
2012-02-02 00:58:42 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Lists:
pgsql-hackers
On Thu, Feb 23, 2012 at 02:08:28PM +0100, Jeroen Vermeulen wrote:
> On 2012-02-23 10:18, Simon Riggs wrote:
>
>> However, review of such a large patch should not be simply pass or
>> fail. We should be looking back at the original problem and ask
>> ourselves whether some subset of the patch could solve a useful subset
>> of the problem. For me, that seems quite likely and this is very
>> definitely an important patch.
>>
>> Even if we can't solve some part of the problem we can at least commit
>> some useful parts of infrastructure to allow later work to happen more
>> smoothly and quickly.
>>
>> So please let's not focus on the 100%, lets focus on 80/20.
>
> The suggested immutable-column constraint was meant as a potential
> "80/20 workaround." Definitely not a full solution, helpful to some,
> probably easier to do. I don't know if an immutable key would actually
> be enough to elide foreign-key locks though.
That alone would not simplify the patch much. INSERT/UPDATE/DELETE on the
foreign side would still need to take some kind of tuple lock on the primary
side to prevent primary-side DELETE. You then still face the complicated case
of a tuple that's both locked and updated (non-key/immutable columns only).
Updates that change keys are relatively straightforward, following what we
already do today. It's the non-key updates that complicate things.
If you had both an immutable column constraint and a never-deleted table
constraint, that combination would be sufficient to simplify the picture.
(Directly or indirectly, it would not actually be a never-deleted constraint
so much as a "you must take AccessExclusiveLock to DELETE" constraint.)
Foreign-side DML would then take an AccessShareLock on the parent table with
no tuple lock at all.
By then, though, that change would share little or no code with the current
patch. It may have its own value, but it's not a means for carving a subset
from the current patch.
Thanks,
nm
In response to
Responses
pgsql-hackers by date
Next :From: Alvaro HerreraDate: 2012-02-23 21:36:42
Subject : Re: foreign key locks, 2nd attempt
Previous :From : Greg SmithDate : 2012-02-23 20:57:55
Subject : Re: swapcache-style cache?