Re: stored procs - Mailing list pgsql-general

From John R Pierce
Subject Re: stored procs
Date
Msg-id 4E85E327.6060801@hogranch.com
Whole thread Raw
In response to stored procs  ("J.V." <jvsrvcs@gmail.com>)
Responses Re: stored procs  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-general
On 09/30/11 2:09 AM, J.V. wrote:
> Some tables have millions of rows,

well, something like UPDATE tablename SET
id=generate_series(1,numberofrows);  will update every row to a
sequential value. However, I have no idea how you would match the
foreign key references in other tables to these new sequence values.

anything that updates a field on a million rows will be causing every
row to be updated... postgres never updates anything in place, it will
be copying the whole row to a new one (this is how it implements MVCC,
and its fundamental to the architecture, there's nothing you can do to
override this behavior).



--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


pgsql-general by date:

Previous
From: Jason Long
Date:
Subject: Re: Any was to prevent a join if no columns are selected from a view?
Next
From: pasman pasmański
Date:
Subject: Re: how to improve this similarity query?