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 1jXABH-0003r5-1b for pgsql-general@arkaria.postgresql.org; Fri, 08 May 2020 21:05:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jXABF-0005dW-Ko for pgsql-general@arkaria.postgresql.org; Fri, 08 May 2020 21:05:13 +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 1jXABF-0005Xq-6D for pgsql-general@lists.postgresql.org; Fri, 08 May 2020 21:05:13 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jXABC-0003zH-NM for pgsql-general@postgresql.org; Fri, 08 May 2020 21:05:12 +0000 Received: by mail-io1-xd2b.google.com with SMTP id d7so3209037ioq.5 for ; Fri, 08 May 2020 14:05:10 -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=yIoH1Uxj6wDpn0B/AmLFIHwsoY+QXN+bV0T2TUBl7Vc=; b=TvRZJ2qs7QOLsH6M/qjfaeGws3lpAvlTMbGnXMI9thv4pQUDdTNrtFEAXi/gZ23+DR GddkPbL7QcC0+SXFukEoQgVwrbQ4D0DJIM0JM8Ns2ijY59PwzJ37GwPECkS2FZFNV2r2 IrG17pc9NyANC/6i27ur2CAmg8cTqQnHnomCzkp02NY2IxtuAKziiW8vPm8PrWQky//8 XjgYIev/vAgVOwWL6+uLH0OwoyX0Xy+ziLpok23nXp9V7tqFbPSq/+Sb5GQkOeJL6dsB 7W8Mu68vFik63Y1VvKZeLmz3JMk+hUH2AAdIH2JuLsH09s7/1HFrja+z34Mvuf1daJP7 zaaw== 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=yIoH1Uxj6wDpn0B/AmLFIHwsoY+QXN+bV0T2TUBl7Vc=; b=bcliSQZoIgnmBOKsFeO52feyKEmtdC6CMNO/aATJqODnqV/DYlfNwv2YOyBGqPl7k0 5p2TWHi1pINUNhXW3u+BcZ56Tyyf6+y1hnrkhAsd+BafdSx04Q1cFrCfdGSaXHRMTruO QKPWqbOeUR+jML7zDUubhTaoEuqB0T9KOubpbIsCQ9AKYVPrixJEJw3K0LVtV4j/b4E2 8kJIntkEfRPgRW2GyUitXNKds2nmPvT62KxEw7nK9Fgq4CnxKu2zoJ1eF8ro6XQRYihu aVwJ0MP8DmlvVv8mKeTD6Zd+UarRjyoj3WpXyEUXTAeAYJZ9+EFTpNylJ5jw5xI6pPhZ xpXQ== X-Gm-Message-State: AGi0PuaPb/sjOr8gSo3JnTZbrdNvcg6cWzB3ajMkqP5rg8w1FuCrWt9/ N4obxf3Ittzi8ePJ1phHNTfIjgez X-Google-Smtp-Source: APiQypJAh7FkWHsW3aNkvonutKCUtgqE+ReiMIEn+Ofps/rDdoyraXvQJAu+xwYAjCPwbByv1Ackfw== X-Received: by 2002:a6b:b486:: with SMTP id d128mr2996618iof.79.1588971909835; Fri, 08 May 2020 14:05:09 -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 w69sm1279318ili.76.2020.05.08.14.05.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2020 14:05:09 -0700 (PDT) From: Rob Sargent Message-Id: <502F77EC-9CEB-4DB6-91D6-3A30F704CF42@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_BDA32F3A-999A-450E-A43E-A20CB9C2D15E" 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 15:05:08 -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> <99D056C8-343D-4823-9C8A-F9C06AD0D926@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=_BDA32F3A-999A-450E-A43E-A20CB9C2D15E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 8, 2020, at 2:57 PM, David G. Johnston = wrote: >=20 > On Fri, May 8, 2020 at 1:51 PM Rob Sargent > wrote: >=20 >> 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 > Wow, I couldn=E2=80=99t disagree more ;) >=20 > Your agreement or disagreement with the problem statement is = immaterial here - the OP has stated what the requirement, for which I = have made a simplistic analogy in order to try and get the point across = to you. As the OP has said it is a poor design - and now it is being = corrected. The request is whether there is some way to do so better = than the two options the OP already described. >=20 > David J. Sorry, I wasn=E2=80=99t disagreeing with the problem statement. OP did = say the =E2=80=9Cinfo.id=E2=80=9D needed to change from 123 to 456. = With the current foreign key alignment that is very expensive. I think = we=E2=80=99re all in agreement there. To push =E2=80=9C456=E2=80=9D = back out to the data table I see as perpetuation of the problem. I = didn=E2=80=99t sense that OP felt it necessary to continue in the = current mode as a requirement. If so, my mistake --Apple-Mail=_BDA32F3A-999A-450E-A43E-A20CB9C2D15E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

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

On Fri, = May 8, 2020 at 1:51 PM Rob Sargent <robjsargent@gmail.com> wrote:

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.

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

Your agreement or = disagreement with the problem statement is immaterial here - the OP has = stated what the requirement, for which I have made a simplistic analogy = in order to try and get the point across to you.  As the OP has = said it is a poor design - and now it is being corrected.  The = request is whether there is some way to do so better than the two = options the OP already described.

David = J.

Sorry, I wasn=E2=80=99t disagreeing with the problem = statement. OP did say the =E2=80=9Cinfo.id=E2=80=9D needed to change from 123 to 456. =  With the current foreign key alignment that is very expensive. =  I think we=E2=80=99re all in agreement there.  To push = =E2=80=9C456=E2=80=9D back out to the data table I see as perpetuation = of the problem.  I didn=E2=80=99t sense that OP felt it necessary = to continue in the current mode as a requirement.  If so, my = mistake

= --Apple-Mail=_BDA32F3A-999A-450E-A43E-A20CB9C2D15E--