Re: Efficient Way to Merge Two Large Tables

From: Joshua Rubin <jrubin(at)esoft(dot)com>
To: Ben Chobot <bench(at)silentmedia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Efficient Way to Merge Two Large Tables
Date: 2010-07-13 22:54:22
Message-ID: AANLkTimNJGymgddXVXizOd84CSjtGfI1MUPfWP5st_iZ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

HI Ben,

> Stupid question before you do this: is there a reason the design was split like this? For instance, if the table with the id and the single field get updated a lot, while the other table almost never changes, maybe this design isn't so bad.

We just wanted to minimize changes to table1, thats why table2 was
added as a separate table and not a new column. Now we need to index
items in table1 with the column in table2 because some queries are
much too slow and would be sped up greatly with this change. In
retrospect, we should have just added a column to table1. Now, we have
all the data, we just need to move it from table2 to table1.

Thanks,
--
Joshua Rubin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Julian Mehnle 2010-07-13 23:08:28 Re: Efficient Way to Merge Two Large Tables
Previous Message Ben Chobot 2010-07-13 22:22:15 Re: Efficient Way to Merge Two Large Tables