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 1n9LnG-00053G-Mn for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jan 2022 06:47:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n9LnE-0005NW-BO for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jan 2022 06:47:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9LnE-0005NL-2B for pgsql-hackers@lists.postgresql.org; Mon, 17 Jan 2022 06:47:04 +0000 Received: from carbon.misis.ru ([85.143.104.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9LnA-0004Q8-6C for pgsql-hackers@lists.postgresql.org; Mon, 17 Jan 2022 06:47:02 +0000 Received: from mail.tzirechnoy.ru (unknown [10.1.250.11]) by carbon.misis.ru (Postfix) with ESMTP id 9E7DF202A6; Mon, 17 Jan 2022 09:46:56 +0300 (MSK) Received: by mail.tzirechnoy.ru (Postfix, from userid 1000) id D618CA42A4; Mon, 17 Jan 2022 09:46:55 +0300 (MSK) Date: Mon, 17 Jan 2022 09:46:55 +0300 From: Ilya Anfimov To: pgsql-hackers@lists.postgresql.org, pgsql-hackers Subject: Re: Add 64-bit XIDs into PostgreSQL 15 Message-ID: <20220117064655.GA613878@azor.tzirechnoy.ru> Mail-Followup-To: Ilya Anfimov , pgsql-hackers@lists.postgresql.org, pgsql-hackers References: <20220104193220.GL15820@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spamd-Result: default: False [-0.00 / 15.00]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_COUNT_TWO(0.00)[2]; BAYES_HAM(-0.00)[29.51%] X-Rspamd-Queue-Id: 9E7DF202A6 X-Rspamd-Server: carbon List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jan 05, 2022 at 06:51:37PM -0500, Bruce Momjian wrote: > On Tue, Jan 4, 2022 at 10:22:50PM +0000, Finnerty, Jim wrote: [skipped] > > with the "double-xmax" representation. This would eliminate a whole > > class of coding errors and would make the code dealing with 64-bit > > XIDs simpler and more maintainable. > > Well, yes, we could do this, and it would avoid the complexity of having > to support two XID representations, but we would need to accept that > fast pg_upgrade would be impossible in such cases, since every page > would need to be checked and potentially updated. > > You might try to do this while the server is first started and running > queries, but I think we found out from the online checkpoint patch that > having the server in an intermediate state while running queries is very > complex --- it might be simpler to just accept two XID formats all the > time than enabling the server to run with two formats for a short > period. My big point is that this needs more thought. Probably, some table storage housekeeping would be wanted. Like a column in pg_class describing the current set of options of the table: checksums added, 64-bit xids added, type of 64-bit xids (probably some would want to add support for the pgpro up- grades), some set of defaults to not include a lot of them in all pageheaders -- like compressed xid/integer formats or extended pagesize. And separate tables that describe the transition state -- like when adding checksums, the desired state for the relation (checksums), and a set of ranges in the table files that are al- ready transitioned/checked. That probably will not introduce too much slowdown at least on reading, and will add the transition/upgrade mechanics. Aren't there were already some discussions about such a feature in the mailing lists? > > > -- > Bruce Momjian https://momjian.us > EDB https://enterprisedb.com > > If only the physical world exists, free will is an illusion. > >