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 1lTbal-0007ur-Ok for pgsql-general@arkaria.postgresql.org; Tue, 06 Apr 2021 02:37:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lTbak-0007RJ-JR for pgsql-general@arkaria.postgresql.org; Tue, 06 Apr 2021 02:37:22 +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 1lTbak-0007RC-5I for pgsql-general@lists.postgresql.org; Tue, 06 Apr 2021 02:37:22 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lTbaa-00029p-2j for pgsql-general@lists.postgresql.org; Tue, 06 Apr 2021 02:37:21 +0000 Received: by mail-io1-xd33.google.com with SMTP id z3so11236301ioc.8 for ; Mon, 05 Apr 2021 19:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=vMV4bnIkSUYa38b3MQy0yl5E3+zGIrlMF7IQ1YI6fM4=; b=KA79dyTbuuMcM/9AIYhLeK+W1qv6P7Eb2X4Mrv1L6f+uzGHgwD4NtefJHHvBviX+b3 8gKQDWRYnoE8YvEojqOcC5/a/eAJdiZ4BUFB4A8f9GbU7+V5KamK5i62d05N5AuAct+R ttmPP9YSsCsDWV4G/vcMtszUROiY10ltm28lIB2axgnXX07q+fL8GZIJx3HjFPVhqB4K bf6RyexlDyAt5atQk2IDViCMhaK+zzJvcQBDpI/QvN8DUvS0Y9iY+rYBOVzSvHsAzAdu swLuIlnnX7ki6m8vPo3JPtYZHMSyLb5CnkhA53UtA0T2H4R6sKtOr5jz04jhGKqMVIXq bE7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=vMV4bnIkSUYa38b3MQy0yl5E3+zGIrlMF7IQ1YI6fM4=; b=lrIdtpx28eKnV4VuQXiXeIFUW9maXwAr1YYutv0d9OHsn38nuGwV5zPLU9hyVOaLzP ohWr2TKX2wkUJJ266sYz0BPPUC6P6ZLfnEdbe2eAugryAyZjQnvfafbdMNg69qOTBAdb GRUfVQYEMshtIaTdMY57fvnFLbhlqS0gofALdyy+EpgVsiJ2BYkVv3VTNBu9n15VEk4m IuqlK1QIdTCw07WOjDA+C3o00jw4FnAr3lPdXKk3Bh3dFe3n21raWcCIEQ/IlAe0zKbd 0WvG49hOR+ITb4Z/RHjon71myRSr1u05hdSywdbk80RtSFO41l+Okcc7CWJhXk6bMvES +K9w== X-Gm-Message-State: AOAM532ojGovgJkSJEyv+KZ2RdrD2hHtmcPZX7QAVIU5mfTuLymy8/zz quaBnXCYIZUO1yArOFqV+6E= X-Google-Smtp-Source: ABdhPJxX6UQaLbeB6pwhqf4LYfvnzduPjG8I6XRLD7jIFr0TB/uJB1vB+iXXu7FQcYuCbUrVIRfCFg== X-Received: by 2002:a5d:88c1:: with SMTP id i1mr21546321iol.115.1617676631210; Mon, 05 Apr 2021 19:37:11 -0700 (PDT) Received: from ?IPv6:2601:681:5500:dde0:19d1:ca52:d666:c200? ([2601:681:5500:dde0:19d1:ca52:d666:c200]) by smtp.gmail.com with ESMTPSA id 14sm12143060ilt.54.2021.04.05.19.37.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Apr 2021 19:37:10 -0700 (PDT) From: Rob Sargent Message-Id: <8ECC2031-7B0F-4765-B8B2-5B8047B06DA3@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_D4B879F6-8E05-4F16-B8D1-B96C17C849A7" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: Primary keys and composite unique keys(basic question) Date: Mon, 5 Apr 2021 20:37:09 -0600 In-Reply-To: Cc: pgsql-general To: Merlin Moncure References: <69a5b7b83689ab456dd4b3cd7eb08e9573652039.camel@cybertec.at> X-Mailer: Apple Mail (2.3608.120.23.2.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_D4B879F6-8E05-4F16-B8D1-B96C17C849A7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 >=20 > It's a small thing, but UUIDs are absolutely not memorizable by > humans; they have zero semantic value. Sequential numeric identifiers > are generally easier to transpose and the value gives some clues to > its age (of course, in security contexts this can be a downside). >=20 I take the above as a definite plus. Spent too much of my life = correcting others=E2=80=99 use of =E2=80=9Cremembered=E2=80=9D id=E2=80=99= s that just happened to perfectly match the wrong thing. > Performance-wise, UUIDS are absolutely horrible for data at scale as > Tom rightly points out. Everything is randomized, just awful. There > are some alternate implementations of UUID that mitigate this but I've > never seen them used in the wild in actual code. >=20 That b-tree=E2=80=99s have been optimized to handle serial ints might be = a considered a reaction to that popular (and distasteful) choice. = Perhaps there should be a =E2=80=99non-optimized=E2=80=99 option. --Apple-Mail=_D4B879F6-8E05-4F16-B8D1-B96C17C849A7 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8


It's a small = thing, but UUIDs are absolutely not memorizable by
humans; they = have zero semantic value.  Sequential numeric identifiers
are generally = easier to transpose and the value gives some clues to
its age (of = course, in security contexts this can be a downside).

I take the above as a definite = plus.  Spent too much of my life correcting others=E2=80=99 use of = =E2=80=9Cremembered=E2=80=9D id=E2=80=99s that just happened to = perfectly match the wrong thing.

Performance-wise, UUIDS are absolutely horrible for data at = scale as
Tom rightly = points out.  Everything is randomized, just awful. =  There
are some = alternate implementations of UUID that mitigate this but I've
never seen = them used in the wild in actual code.


That b-tree=E2=80=99s have been optimized to handle = serial ints might be a considered a reaction to that popular (and = distasteful) choice.  Perhaps there should be a =E2=80=99non-optimize= d=E2=80=99 option.


= --Apple-Mail=_D4B879F6-8E05-4F16-B8D1-B96C17C849A7--