Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNOho-00073w-58 for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2019 22:02:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iNOhl-0008Ui-AS for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2019 22:02:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNOhk-0008Ub-MY for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2019 22:02:09 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iNOhi-0007DB-8O for pgsql-general@postgresql.org; Wed, 23 Oct 2019 22:02:07 +0000 Received: by mail-pf1-x42d.google.com with SMTP id v4so13763536pff.6 for ; Wed, 23 Oct 2019 15:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=v5UxJbC4B+ethRe1oehvYYbk9+GcBEi/XHp3b4qb7AM=; b=Y+YGG4sckUy6I9WgTrpZ3GZDysL7OgvZgt5EkmypaI2f+P+EaXQCwcjlKA7AxSDolD pJaXAR5dLW2KfXMLFdZwwDMrmQm2Ve+86PFQPX8u6Mj919m2MfHLydeNPIa/Mv86scy2 OUlq9Z3Adf2TDQvuQvWRT1KD7TX9lKjbOF9krIBGu4GWnQDYH8ccV4AWUr6zmUZ8fLHW Gvd5biWLlDzJiKhPM7XQ2FE141rIq5HtJMLwxjLE1fDikn7xs/GJhpY10dTcpvnMPeI/ knw+DLMpfe2TJC63V0cqF3n9rjZ3hxUmQ8Qza1Zf7yrqmxnf+DRz2ZD+RM93XWySHc8K M7xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=v5UxJbC4B+ethRe1oehvYYbk9+GcBEi/XHp3b4qb7AM=; b=JkEe+mxg5ZXrW6f3Hw3qi22okI9t2xP5V47GOPxxvlV7+GIpHwbfL5ttlQAz4sag7c oN7LBYYn/j5Oj/cPgM8q5hb6Nl8RjXLOM0Uil1aDVgcpkWvoCucgG1WgkXC98Jsg6NlI 9M7YYzn3QUu0aQQn96dLiGRcouTINxlH61DgFTbeRG9o/SoYZRs8+uFxV6VN2hDPQ9o9 ZXyfEOMHmxd9QCcFKzbg9Zzr2/sifRsjXMQA9pr2RevccutEy8dgCFP1KaZbCGzB1HFn 7hPZySpLkhO1wTVEYpwv3gm1Q49d8l/yeCz2OcpT9zSLnfV0UK4gLAMwsorcZqnIXZ2F AU3Q== X-Gm-Message-State: APjAAAWmGwybILpxUors7ilDkN6MW9v8cLl3QiMeHiS1ftcy2O2siv80 WBVJnNzvHu6GPYcqcUuKAbGshNik X-Google-Smtp-Source: APXvYqztnmYsP54bi8B3ZiIz9U8SQ5afCmnVEPJc9QiKnNpLEppZsuTvL2bpeixWVF4a0LblBHxQ/A== X-Received: by 2002:a63:1564:: with SMTP id 36mr12770182pgv.149.1571868124275; Wed, 23 Oct 2019 15:02:04 -0700 (PDT) Received: from [10.104.134.41] ([155.100.47.1]) by smtp.gmail.com with ESMTPSA id i22sm24790574pgg.20.2019.10.23.15.02.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2019 15:02:03 -0700 (PDT) Subject: Re: Composite type storage overhead To: =?UTF-8?Q?Laiszner_Tam=c3=a1s?= Cc: "pgsql-general@postgresql.org" References: <90AA42A6-38FC-4117-90B5-4539302CA154@gmail.com> From: Rob Sargent Message-ID: Date: Wed, 23 Oct 2019 16:02:02 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------9E47B23EF9873B0858384360" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------9E47B23EF9873B0858384360 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 10/23/19 3:24 PM, Laiszner Tamás wrote: > That's an absolutely reasonable suggestion. I am still in the > exploration phase so while this solution is not completely ruled out, > I have some concerns about it: > > 1. > Although it does not enforce, but the UUID type kind of suggests a > specific interpretation of the data. Of course the documentation > says you are free to use any algorithm to generate the values, but > there are quite a few standard UUID types and we are not planning > to use any of them. > 2. > The serialization format is different than needed by the > application and, while once again this is not a hard technical > barrier, that might cause slight additional complexity and confusion. > 3. > The value is logically defined as a 128-bit integer, that is in > itself a compound value split into a few "bit groups". Extracting > these parts can be done by simple (and supposedly efficient) > bitwise operators when stored as integer, but becomes much more > cumbersome with UUID, I guess. > > ------------------------------------------------------------------------ > *Feladó:* Rob Sargent > *Elküldve:* 2019. október 23., szerda 22:58 > *Címzett:* Laiszner Tamás > *Másolatot kap:* pgsql-general@postgresql.org > > *Tárgy:* Re: Composite type storage overhead > > >> On Oct 23, 2019, at 1:32 PM, Laiszner Tamás > > wrote: >> >> Hey there, >> >> I am currently exploring the options to utilize 128-bit numeric >> primary keys. One of the options I am looking at is to store them as >> composites of two 64-bit integers. >> >> I would highly appreciate any comments or additional information on >> this topic. >> >> Best regards, >> Tamas > Why not use UUID type? > Putting logic and meaning into primary keys?  To what end, I wonder. --------------9E47B23EF9873B0858384360 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit


On 10/23/19 3:24 PM, Laiszner Tamás wrote:
That's an absolutely reasonable suggestion. I am still in the exploration phase so while this solution is not completely ruled out, I have some concerns about it:
  1. Although it does not enforce, but the UUID type kind of suggests a specific interpretation of the data. Of course the documentation says you are free to use any algorithm to generate the values, but there are quite a few standard UUID types and we are not planning to use any of them.
  2. The serialization format is different than needed by the application and, while once again this is not a hard technical barrier, that might cause slight additional complexity and confusion.
  3. The value is logically defined as a 128-bit integer, that is in itself a compound value split into a few "bit groups". Extracting these parts can be done by simple (and supposedly efficient) bitwise operators when stored as integer, but becomes much more cumbersome with UUID, I guess.

Feladó: Rob Sargent <robjsargent@gmail.com>
Elküldve: 2019. október 23., szerda 22:58
Címzett: Laiszner Tamás <t.laiszner@outlook.com>
Másolatot kap: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Tárgy: Re: Composite type storage overhead
 


On Oct 23, 2019, at 1:32 PM, Laiszner Tamás <t.laiszner@outlook.com> wrote:

Hey there,

I am currently exploring the options to utilize 128-bit numeric primary keys. One of the options I am looking at is to store them as composites of two 64-bit integers.

I would highly appreciate any comments or additional information on this topic.

Best regards,
Tamas
Why not use UUID type?


Putting logic and meaning into primary keys?  To what end, I wonder.

--------------9E47B23EF9873B0858384360--