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 1jX9xo-0003My-KM for pgsql-general@arkaria.postgresql.org; Fri, 08 May 2020 20:51:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jX9xn-0002rS-Fo for pgsql-general@arkaria.postgresql.org; Fri, 08 May 2020 20:51:19 +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 1jX9xn-0002rL-1Y for pgsql-general@lists.postgresql.org; Fri, 08 May 2020 20:51:19 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jX9xk-0003rv-Ko for pgsql-general@postgresql.org; Fri, 08 May 2020 20:51:18 +0000 Received: by mail-il1-x134.google.com with SMTP id r2so2671024ilo.6 for ; Fri, 08 May 2020 13:51:16 -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=Y568UwBn89MedVhtld2U5ikbWyj9IsU40DwdvDdEOOQ=; b=NpeXC2Zl3D6A51CqAl+fN/NtH5AKSAsjKmFopSC+jJ7gi4DvKv4H3Uroc0GR02yGvP BfkrEXOa6qsSg+oDqYrJ2GhgQIdQWeSmMmpOw3p61EVnGJBQ/6rOqPAkeYYcwNVMym/V Fxk6fgLqiYfFT3gT/U8UNihnjKo5H2edf+x2/4mcXzaIr+2xBeTT/kA0AUao/V9lnBAF SDRH0xwSVaYjlkD7RWtV85VluSfi3DUjuLXicebDcmWdKIU9j3CrNsc+wGA3UgePEpWG ucNSLELEatUkuq5rSTVk8X50UkiSGLqbw5YSYEHp1zGNshSvEo7hPIJQX6OeMSZ1Rl2I 35mw== 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=Y568UwBn89MedVhtld2U5ikbWyj9IsU40DwdvDdEOOQ=; b=jXUKfimvHNkx92FYctWtX1W97/Giz61COxbiQ+5ILYPE4iC/M+c/KfeuAIVSu2E/c6 uH7kdzbxa0VKRjEugAvnGvATkkgh1x6P7/vsqPKxE7B2ijZx73XTJ19gktIrzEZFQzjG HNbmFgTglLmZpBNOTP6bZQVkikTcDl4Iy2WY5Bga7VEZL4T599xIEnOJ0j8UCoNSqkTB wAkEP+YpBX/r1GDu3Qqxk2W78UCVCiT6NbVJEFiWKoNpmVslgF/HSEb3fDXUyMjCfXI3 iSgHrb7/xwnUHoxwOobbn8SDIByuUxG8dn7IRqx8YzTY1B+UHbrOBqhEpyp059lMrIR9 WN0g== X-Gm-Message-State: AGi0PuYI4jio1Olj+6uKVgkyoJP1iaX4su5M1ssUB5TqSZMM0f96DV+d dcqootZAXLZaIn0cNkmnfdQ= X-Google-Smtp-Source: APiQypKmDWw+ZMYabM/p0yr9YaazIBNPRPfYfBCA+hBIO3oHM5nxsDzPdSga1zgAPd63dX6om/oBmg== X-Received: by 2002:a92:3a09:: with SMTP id h9mr4667232ila.5.1588971075604; Fri, 08 May 2020 13:51:15 -0700 (PDT) Received: from ?IPv6:2601:681:5500:dde0:13f:ef9:c6d0:c102? ([2601:681:5500:dde0:13f:ef9:c6d0:c102]) by smtp.gmail.com with ESMTPSA id w1sm1286406ila.63.2020.05.08.13.51.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2020 13:51:15 -0700 (PDT) From: Rob Sargent Message-Id: <99D056C8-343D-4823-9C8A-F9C06AD0D926@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_88A2AE6F-B4C1-4F73-ADA3-936DE6E0A20B" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Thoughts on how to avoid a massive integer update. Date: Fri, 8 May 2020 14:51:13 -0600 In-Reply-To: Cc: "Fehrle, Brian" , "pgsql-general@postgresql.org" To: "David G. Johnston" References: <129e882d-fe4c-0ce9-1966-acbcbf94c309@aklaver.com> <0F5992D4-9317-4007-9036-202DC89BA0D8@comscore.com> <8491BCF6-2163-4765-BCCF-E96B845D7427@comscore.com> <8FA70C91-57D3-4AD6-9780-48AD0728CF3C@gmail.com> <7171C32C-B8BC-4721-9938-8F6BA4E38BC7@gmail.com> X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_88A2AE6F-B4C1-4F73-ADA3-936DE6E0A20B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 8, 2020, at 2:43 PM, David G. Johnston = wrote: >=20 > On Fri, May 8, 2020 at 1:41 PM Rob Sargent > wrote: > My understanding is the keys in the info_table need to change. That = causes the very expensive update in the update in the data tables. No?=20= >=20 > The keys in the info_table need to change because their contents are = no longer legal to be stored (OP has not specified but think using an = integer value of someones social security number as a key). The FK side = of the relationship equality has the same illegal data values problem = and need to be changed too. >=20 > David J. >=20 Wow, I couldn=E2=80=99t disagree more ;) Let=E2=80=99s say it were an ssn. A side from the fact that those are = mutable and should not be used as an id (not to say identifier), the ssn = should only be in the table aligned with that_person. Other tables = refering to that person should use the locally assigned and arbitrary = identifier for that person. (Frankly there is no =E2=80=9Cnatural = key=E2=80=9D for a person.) The scheme I propose has a chance of completing relatively unobtrusively = and quickly allowing a migration over time if deemed necessary. Likely = to finished just in time for the next interuption. --Apple-Mail=_88A2AE6F-B4C1-4F73-ADA3-936DE6E0A20B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On May 8, 2020, at 2:43 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:

On Fri, May = 8, 2020 at 1:41 PM Rob Sargent <robjsargent@gmail.com> wrote:
My understanding is the keys in = the info_table need to change.  That causes the very expensive = update in the update in the data tables. = No? 

The keys in the = info_table need to change because their contents are no longer legal to = be stored (OP has not specified but think using an integer value of = someones social security number as a key).  The FK side of the = relationship equality has the same illegal data values problem and need = to be changed too.

David J.

Wow, I couldn=E2=80=99t disagree more ;)

Let=E2=80=99s say it = were an ssn.  A side from the fact that those are mutable and = should not be used as an id (not to say identifier), the ssn should only = be in the table aligned with that_person.  Other tables refering to = that person should use the locally assigned and arbitrary identifier for = that person.  (Frankly there is no =E2=80=9Cnatural key=E2=80=9D = for a person.)

The scheme I propose has a chance of completing relatively = unobtrusively and quickly allowing a migration over time if deemed = necessary.  Likely to finished just in time for the next = interuption.

= --Apple-Mail=_88A2AE6F-B4C1-4F73-ADA3-936DE6E0A20B--