Re: Why Does UPDATE Take So Long? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Why Does UPDATE Take So Long?
Date
Msg-id dcc563d10809301242td607499se0ba587758d97945@mail.gmail.com
Whole thread Raw
In response to Why Does UPDATE Take So Long?  (Bill Thoen <bthoen@gisnet.com>)
Responses Re: Why Does UPDATE Take So Long?  (Bill Thoen <bthoen@gisnet.com>)
List pgsql-general
On Tue, Sep 30, 2008 at 1:00 PM, Bill Thoen <bthoen@gisnet.com> wrote:
> Working with PG 8.1 I'm trying to update a char(4) column, and it's taking a
> very long time; 15 minutes so far and no end in sight. From the explain, it
> doesn't seem like it should take that long, and this column is not indexed.
> Sure, there's 2.7 million records but it only takes a few minutes to scan
> the whole file. Is there some special overhead I should be aware of with an
> UPDATE? I VACUUMed and ANALYZEd first, too.
>
> Or am I just expecting too much?

The problem is that on older versions of pgsql, the db had to update
each index for each row updated as well as the rows.  The latest
version, with a low enough fill factor, can update non-indedexed
fields by using the free space in each page and not have to hit the
indexes.  But on 8.1 you don't get that optimization.

pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Why Does UPDATE Take So Long?
Next
From: Bill Thoen
Date:
Subject: Re: Why Does UPDATE Take So Long?