From: Rob Sargent <robjsargent@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Fehrle, Brian <bfehrle@comscore.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Thoughts on how to avoid a massive integer update.
Date: Fri, 8 May 2020 15:05:08 -0600
Message-ID: <502F77EC-9CEB-4DB6-91D6-3A30F704CF42@gmail.com> (raw)
In-Reply-To: <CAKFQuwbeTJitNUMasKtjTopbs-bcVurvPVth9oTACGRVKhCKAg@mail.gmail.com>
References: <C7D3EE42-66B9-44AF-83F4-CB7F0F42486E@comscore.com>
<129e882d-fe4c-0ce9-1966-acbcbf94c309@aklaver.com>
<0F5992D4-9317-4007-9036-202DC89BA0D8@comscore.com>
<E3B6D3D1-D60E-40D9-8855-B23F7EDBFA8E@gmail.com>
<8491BCF6-2163-4765-BCCF-E96B845D7427@comscore.com>
<8FA70C91-57D3-4AD6-9780-48AD0728CF3C@gmail.com>
<CAKFQuwYh5qfo752TxAu6SrwXB5zAd-N_p00CKJZ8+fKm0WsWAw@mail.gmail.com>
<7171C32C-B8BC-4721-9938-8F6BA4E38BC7@gmail.com>
<CAKFQuwYkvURpOY+pJSX53kEfmx6-xzJpLYdT9Au0Ppf3_Q34Wg@mail.gmail.com>
<99D056C8-343D-4823-9C8A-F9C06AD0D926@gmail.com>
<CAKFQuwbeTJitNUMasKtjTopbs-bcVurvPVth9oTACGRVKhCKAg@mail.gmail.com>
> 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 <mailto:robjsargent@gmail.com>> wrote:
>
>> On May 8, 2020, at 2:43 PM, David G. Johnston <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>> wrote:
>>
>> On Fri, May 8, 2020 at 1:41 PM Rob Sargent <robjsargent@gmail.com <mailto: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’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’t disagreeing with the problem statement. OP did say the “info.id” needed to change from 123 to 456. With the current foreign key alignment that is very expensive. I think we’re all in agreement there. To push “456” back out to the data table I see as perpetuation of the problem. I didn’t sense that OP felt it necessary to continue in the current mode as a requirement. If so, my mistake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: robjsargent@gmail.com, david.g.johnston@gmail.com, bfehrle@comscore.com
Subject: Re: Thoughts on how to avoid a massive integer update.
In-Reply-To: <502F77EC-9CEB-4DB6-91D6-3A30F704CF42@gmail.com>
References: <C7D3EE42-66B9-44AF-83F4-CB7F0F42486E@comscore.com> <129e882d-fe4c-0ce9-1966-acbcbf94c309@aklaver.com> <0F5992D4-9317-4007-9036-202DC89BA0D8@comscore.com> <E3B6D3D1-D60E-40D9-8855-B23F7EDBFA8E@gmail.com> <8491BCF6-2163-4765-BCCF-E96B845D7427@comscore.com> <8FA70C91-57D3-4AD6-9780-48AD0728CF3C@gmail.com> <CAKFQuwYh5qfo752TxAu6SrwXB5zAd-N_p00CKJZ8+fKm0WsWAw@mail.gmail.com> <7171C32C-B8BC-4721-9938-8F6BA4E38BC7@gmail.com> <CAKFQuwYkvURpOY+pJSX53kEfmx6-xzJpLYdT9Au0Ppf3_Q34Wg@mail.gmail.com> <99D056C8-343D-4823-9C8A-F9C06AD0D926@gmail.com> <CAKFQuwbeTJitNUMasKtjTopbs-bcVurvPVth9oTACGRVKhCKAg@mail.gmail.com> <502F77EC-9CEB-4DB6-91D6-3A30F704CF42@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox