Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rkiwQ-00ErWy-Ik for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Mar 2024 11:08:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rkiwO-00GolD-Ox for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Mar 2024 11:08:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rkiwO-00Gol5-FY for pgsql-hackers@lists.postgresql.org; Thu, 14 Mar 2024 11:08:04 +0000 Received: from fout7-smtp.messagingengine.com ([103.168.172.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rkiwM-004SrJ-3T for pgsql-hackers@postgresql.org; Thu, 14 Mar 2024 11:08:04 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 3B7E113800A1; Thu, 14 Mar 2024 07:08:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 14 Mar 2024 07:08:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm3; t=1710414480; x=1710500880; bh=Elz4cEpLj0qt1hXhPTB9sss+c90jolc7 fa/m17zBraE=; b=IgLLxkA6DW/jPvBjNsxt4HisBp6UCrSgjx0J203P+AFxdjfl UtB5lS4ChmHqu8yF8ojdMAMAyxllpstNERw6cx/TGt1uMpeUD6nbv54+NlmdItdZ vbBwnIMpxlDJtZkogrvXRWYTDgRYXEjkcgRbW/UR0Y1G8ICrFzOPOL3W3VQ6UUBS kEya9pVrTYGVAPLHLaBj2BX49MfyFNVlQQDBlc4pBh6YzGeunBSdnX/GF6TbQzHl TUwNDB2f61rmxGHKnx1fsH9UClk7zQGnL/XGgJUhvJNta3zE0gFshUvmzdcfzAj2 s/j3pvIfRuedaIQW/uGZ7UUdtP4umxCQKfayCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1710414480; x= 1710500880; bh=Elz4cEpLj0qt1hXhPTB9sss+c90jolc7fa/m17zBraE=; b=P mGYy0JrWDSX8TY7hM/4317SnzwtyoEvxgMfHGPf952xsu3pJ2VDQA4lv7K7DCrUu pcyrY9bubtffsKAI6pyLDJQeg+pvFyQ5RTURclgzmf97HJC/PB7N2xR2/KuSQURb 2yCNAO1gGV80XZbsnaXFEEbAPau2QlY/zU3XwTwrrE1op3nAiI5wTIZisTPTEjH+ zqLKQAhDa1XoHHsqQqw9a9ISgyonwidRshcveFRLIVH1kHHTENSNjWLjq8hSlOwQ u0KGzyJKVt1iruQpmTPDBxrzPLs01FKLJNP0Sg3pHaGq0Vh4bztOQOSyurbceNWA vIwl2A8KM/d6s+DZaUfQg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrjeejgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqe enucggtffrrghtthgvrhhnpefgjedthfekfedtuefgieelheetleejgefhueeltdfhueet vdffudekfeejhfegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Mar 2024 07:07:57 -0400 (EDT) Message-ID: Date: Thu, 14 Mar 2024 12:07:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: UUID v7 Content-Language: en-US To: "Andrey M. Borodin" Cc: Sergey Prokhorenko , Jelte Fennema-Nio , pgsql-hackers mailing list , Aleksander Alekseev , =?UTF-8?Q?Przemys=C5=82aw_Sztoch?= , "David G. Johnston" , Mat Arye , Matthias van de Meent , Nikolay Samokhvalov , Junwang Zhao References: <0A0D7507-C434-46AC-BCC4-1166C5A2742A@yandex-team.ru> <1459150585.359059.1706132985954@mail.yahoo.com> <00B784AB-5B52-4CC7-8A0D-B1C0C53B52DC@yandex-team.ru> <1014147035.642629.1706202245918@mail.yahoo.com> <5932FFF8-4E5F-44DC-8FEA-22E8302759C7@yandex-team.ru> <8AA22330-7D3A-46CF-B311-2FF874D7C713@yandex-team.ru> <1971811009.2132347.1706599708209@mail.yahoo.com> <72C1E7CB-E2EC-46CF-AD2C-B3180CED885B@yandex-team.ru> <0906F8BA-CA52-4956-AA68-E9193E50DFDF@yandex-team.ru> <10553e4c-6b66-44b9-86a7-80bb1958a767@eisentraut.org> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10.03.24 13:59, Andrey M. Borodin wrote: >> The functions uuid_extract_ver and uuid_extract_var could be named >> uuid_extract_version and uuid_extract_variant. Otherwise, it's hard >> to tell them apart, with only one letter different. > > Renamed. Another related comment: Throughout your patch, swap the order of uuid_extract_variant and uuid_extract_version. First, this makes more sense because version is subordinate to variant, and also it makes it alphabetical. >> I think the behavior of uuid_extract_var(iant) is wrong. The code >> takes just two bits to return, but the draft document is quite clear >> that the variant is 4 bits (see Table 1). > > Well, it was correct only for implemented variant. I've made version that implements full table 1 from section 4.1. I think we are still interpreting this differently. I think uuid_extract_variant should just return whatever is in those four bits. Your function comment says "Can return only 0, 0b10, 0b110 and 0b111.", which I don't think it is correct. It should return 0 through 15. >> I would have expected that, since gettimeofday() provides microsecond >> precision, we'd put the extra precision into "rand_a" as per Section 6.2 method 3. > > I had chosen method 2 over method 3 as most portable. Can we be sure how many bits (after reading milliseconds) are there across different OSes? I think this should have been researched. If we don't know how many bits we have, how do we know we have enough for milliseconds? I think we should at least have some kind of idea, if we are going to have this conversation.