Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYeWd-0003B7-TW for pgsql-hackers@arkaria.postgresql.org; Tue, 12 May 2020 23:41:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYeWc-00040N-Jt for pgsql-hackers@arkaria.postgresql.org; Tue, 12 May 2020 23:41:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYeWc-00040E-DI for pgsql-hackers@lists.postgresql.org; Tue, 12 May 2020 23:41:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYeWZ-00035t-9D for pgsql-hackers@lists.postgresql.org; Tue, 12 May 2020 23:41:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 04CNfJMl024596; Tue, 12 May 2020 19:41:19 -0400 From: Tom Lane To: Alvaro Herrera cc: Robert Haas , PostgreSQL Hackers Subject: Re: Our naming of wait events is a disaster. In-reply-to: <9871.1589321468@sss.pgh.pa.us> References: <20200512202726.GA31125@alvherre.pgsql> <9871.1589321468@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 12 May 2020 18:11:08 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24594.1589326879.1@sss.pgh.pa.us> Date: Tue, 12 May 2020 19:41:19 -0400 Message-ID: <24595.1589326879@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk For the specific category of the heavyweight lock types, I'm now thinking that we can't change the event names very much, because those are also exposed in pg_locks' locktype column. We can be darn certain, for example, that changing the spelling of "relation" in that column would break a lot of user queries. Conceivably we could decouple the wait event names from the locktype column, but on the whole that doesn't seem like a great plan. However, having said that, I remain on the warpath about "speculative token". That's an utterly horrid choice for both locktype and wait event. I also notice, with no amusement, that "speculative token" is not documented in the pg_locks documentation. So I think we should change it ... but to what, exactly? Looking at the other existing names: const char *const LockTagTypeNames[] = { "relation", "extend", "page", "tuple", "transactionid", "virtualxid", "speculative token", "object", "userlock", "advisory" }; I'm inclined to propose "spectoken". I'd be okay with "spec_token" as well, but there are not underscores in the longer-established names. (Needless to say, this array is going to gain a comment noting that there are two places to document any changes. Also, if we split up the wait_event table as discussed earlier, it might make sense for pg_locks' documentation to cross-reference the sub-table for heavyweight lock events, since that has some explanation of what the codes mean.) regards, tom lane