Search Postgresql Archives

Re: Need to update all my 60 million rows at once without transactional integrity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 23, 2008 at 9:04 AM, Alvaro Herrera
<alvherre@xxxxxxxxxxxxxxxxx> wrote:
> christian_behrens@xxxxxxx wrote:
>
>
> > How can I make a Update of a column in a very large table for all rows
>  > without using the double amount of disc space and without any need for
>  > atomic operation?
>  >
>  > I have a very large table with about 60 million rows. I sometimes need
>  > to do a simple update to ALL rows that resets a status-flag to zero.
>
>  Perhaps you should rethink your data model.

for example:
*) change status-flag to a timestamp
*) make a new table (status_reset or something) with one column, one row...and
*) make a view (perhaps swapping names with your original table) that
joins the two tables and preserves the 1/0 status flag column
appearance so you don't have to change the app.

Consider the fundamental tenet: 'If PostgreSQL can't do it well, you
are probably doing it the wrong way' :-)

merlin


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux