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

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Need to update all my 60 million rows at once without transactional integrity
Дата
Msg-id b42b73150804230827w3a2fb591p9c2839f255903f54@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Need to update all my 60 million rows at once without transactional integrity  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
On Wed, Apr 23, 2008 at 9:04 AM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> christian_behrens@gmx.net 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Debian etch, backport postgresql 8.3 experiences?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Backup setup