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:41:34 -0600
Message-ID: <7171C32C-B8BC-4721-9938-8F6BA4E38BC7@gmail.com> (raw)
In-Reply-To: <CAKFQuwYh5qfo752TxAu6SrwXB5zAd-N_p00CKJZ8+fKm0WsWAw@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>
> On May 8, 2020, at 2:37 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
>
> On Fri, May 8, 2020 at 12:49 PM Rob Sargent <robjsargent@gmail.com <mailto:robjsargent@gmail.com>> wrote:
> Well as I said, I think you could add a column to info_table
> alter table info_table add orig_id int;
> update info_table set orig_id = info_table_sid;
>
> update info_table set info_table_sid = 456 where info_table_sid = 456;
>
> huh?
>
> alter table data_table drop reference NOT SQL
> alter table data_table make reference to info_table.orig_id NOT SQL
>
> You don't seem to understand the requirement. The data_table integer value must be changed - all you are doing is a convoluted column rename on the table holding the PK half of the relationship.
>
> David J.
>
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? =
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: <7171C32C-B8BC-4721-9938-8F6BA4E38BC7@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>
* 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