Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Andres Freund <andres@anarazel.de>, Mithun Cy <mithun.cy@enterprisedb.com>, Tom Lane <tgl@sss.pgh.pa.us>, Thomas Munro <thomas.munro@enterprisedb.com>,
Amit Kapila <amit.kapila16@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-04-26T19:08:24Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow page lock to conflict among parallel group members.
- 3ba59ccc896e 13.0 landed
-
Allow relation extension lock to conflict among parallel group members.
- 85f6b49c2c53 13.0 landed
-
Add assert to ensure that page locks don't participate in deadlock cycle.
- 72e78d831ab5 13.0 landed
-
Assert that we don't acquire a heavyweight lock on another object after
- 15ef6ff4b985 13.0 landed
-
Fix unsafe usage of strerror(errno) within ereport().
- 81256cd05f07 11.0 cited
On Thu, Apr 26, 2018 at 2:10 AM, Masahiko Sawada <sawada.mshk@gmail.com> wrote: > Thank you for sharing. That's good to know. > > Andres pointed out the performance degradation due to hash collision > when multiple loading. I think the point is that it happens at where > users don't know. Therefore even if we make N_RELEXTLOCK_ENTS > configurable parameter, since users don't know the hash collision they > don't know when they should tune it. > > So it's just an idea but how about adding an SQL-callable function > that returns the estimated number of lock waiters of the given > relation? Since user knows how many processes are loading to the > relation, if a returned value by the function is greater than the > expected value user can know hash collision and will be able to start > to consider to increase N_RELEXTLOCK_ENTS. I don't think that's a very useful suggestion. Changing N_RELEXTLOCK_ENTS requires a recompile, which is going to be impractical for most users. Even if we made it a GUC, we don't want users to have to tune stuff like this. If we actually think this is going to be a problem, we'd probably better rethink the desgin. I think the real question is whether the scenario is common enough to worry about. In practice, you'd have to be extremely unlucky to be doing many bulk loads at the same time that all happened to hash to the same bucket. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company