pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 14:51:13 -0600
Message-ID: <99D056C8-343D-4823-9C8A-F9C06AD0D926@gmail.com> (raw)
In-Reply-To: <CAKFQuwYkvURpOY+pJSX53kEfmx6-xzJpLYdT9Au0Ppf3_Q34Wg@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>



> 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 <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.
> 
> David J.
> 
Wow, I couldn’t disagree more ;)

Let’s 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 “natural key” 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.

view thread (19+ messages)  latest in thread

Message-ID: <99D056C8-343D-4823-9C8A-F9C06AD0D926@gmail.com>
Permalink:  ../99D056C8-343D-4823-9C8A-F9C06AD0D926@gmail.com/
Also on:    postgresql.org/message-id/99D056C8-343D-4823-9C8A-F9C06AD0D926@gmail.com

 · 

reply

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: <99D056C8-343D-4823-9C8A-F9C06AD0D926@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>

* 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