Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Rob Sargent
t; mailto:bfeh...@comscore.com>>, > "pgsql-gene...@postgresql.org <mailto:pgsql-gene...@postgresql.org>" > mailto:pgsql-gene...@postgresql.org>> > Subject: Re: Thoughts on how to avoid a massive integer update. > > [External Email] > > > >

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Fehrle, Brian
up that way from the beginning (over a decade ago), this is what I’m stuck with. Blah. From: Rob Sargent Date: Friday, May 8, 2020 at 3:05 PM To: "David G. Johnston" Cc: "Fehrle, Brian" , "pgsql-gene...@postgresql.org" Subject: Re: Thoughts on how to

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Rob Sargent
> On May 8, 2020, at 2:57 PM, David G. Johnston > wrote: > > On Fri, May 8, 2020 at 1:51 PM Rob Sargent > wrote: > >> On May 8, 2020, at 2:43 PM, David G. Johnston > > wrote: >> >> On Fri, May 8, 2020 at 1:41 PM Rob Sargent >

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread David G. Johnston
On Fri, May 8, 2020 at 1:51 PM Rob Sargent wrote: > > On May 8, 2020, at 2:43 PM, David G. Johnston > wrote: > > 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 d

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Rob Sargent
> On May 8, 2020, at 2:43 PM, David G. Johnston > wrote: > > 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? > >

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread David G. Johnston
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? > The keys in the info_table need to change because their contents are no longer legal to be stored (O

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Rob Sargent
> On May 8, 2020, at 2:37 PM, David G. Johnston > wrote: > > On Fri, May 8, 2020 at 12:49 PM Rob Sargent > 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

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread David G. Johnston
On Fri, May 8, 2020 at 12:49 PM Rob Sargent 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? alte

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Rob Sargent
8, 2020 at 11:05 AM > To: "Fehrle, Brian" mailto:bfeh...@comscore.com>> > Cc: Adrian Klaver <mailto:adrian.kla...@aklaver.com>>, "pgsql-gene...@postgresql.org > <mailto:pgsql-gene...@postgresql.org>" <mailto:pgsql-gene...@postgresql.org>> >

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Fehrle, Brian
From: Rob Sargent Date: Friday, May 8, 2020 at 11:05 AM To: "Fehrle, Brian" Cc: Adrian Klaver , "pgsql-gene...@postgresql.org" Subject: Re: Thoughts on how to avoid a massive integer update. [External Email] Could you show an example table relationship? It’s

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Fehrle, Brian
From: "David G. Johnston" Date: Friday, May 8, 2020 at 11:48 AM To: "Fehrle, Brian" Cc: "pgsql-gene...@postgresql.org" Subject: Re: Thoughts on how to avoid a massive integer update. [External Email] On Mon, May 4, 2020 at 2:33 PM Fehrle, Brian mailto:bfeh..

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread David G. Johnston
On Mon, May 4, 2020 at 2:33 PM Fehrle, Brian wrote: > I NEED to update every single row in all these tables, changing the > integer value to a different integer. > > > Does anyone have any hackery ideas on how to achieve this in less time? > Probably the only solution that would perform computa

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Rob Sargent
>Could you show an example table relationship? > > It’s a simple one-to-many relationship: > *Info_table* > info_table_sid integer > > > *data_table* > data_table_sid integer, > info_table_id integer references info_table(info_table_sid), > > > Right, and now you wish to change the value

Re: Thoughts on how to avoid a massive integer update.

2020-05-08 Thread Fehrle, Brian
On 5/4/20, 3:56 PM, "Adrian Klaver" wrote: [External Email] On 5/4/20 2:32 PM, Fehrle, Brian wrote: > Hi all, > > This is a shot in the dark in hopes to find a magic bullet to fix an > issue I have, I can’t personally think of any solution myself. > > I

Re: Thoughts on how to avoid a massive integer update.

2020-05-05 Thread Peter J. Holzer
On 2020-05-04 21:32:56 +, Fehrle, Brian wrote: > I have a database with hundreds of terabytes of data, where every table has an > integer column referencing a small table. For reasons out of my control and > cannot change, I NEED to update every single row in all these tables, changing > the in

Re: Thoughts on how to avoid a massive integer update.

2020-05-04 Thread Rob Sargent
On 5/4/20 3:32 PM, Fehrle, Brian wrote: Hi all, This is a shot in the dark in hopes to find a magic bullet to fix an issue I have, I can’t personally think of any solution myself. I have a database with hundreds of terabytes of data, where every table has an integer column referencing a s

Re: Thoughts on how to avoid a massive integer update.

2020-05-04 Thread Rob Sargent
On 5/4/20 3:32 PM, Fehrle, Brian wrote: Hi all, This is a shot in the dark in hopes to find a magic bullet to fix an issue I have, I can’t personally think of any solution myself. I have a database with hundreds of terabytes of data, where every table has an integer column referencing a s

Re: Thoughts on how to avoid a massive integer update.

2020-05-04 Thread Adrian Klaver
On 5/4/20 2:32 PM, Fehrle, Brian wrote: Hi all, This is a shot in the dark in hopes to find a magic bullet to fix an issue I have, I can’t personally think of any solution myself. I have a database with hundreds of terabytes of data, where every table has an integer column referencing a smal

Thoughts on how to avoid a massive integer update.

2020-05-04 Thread Fehrle, Brian
Hi all, This is a shot in the dark in hopes to find a magic bullet to fix an issue I have, I can’t personally think of any solution myself. I have a database with hundreds of terabytes of data, where every table has an integer column referencing a small table. For reasons out of my control and