Re: How to make update rapidly?

From: hewei <heweiweihe(at)gmail(dot)com>
To: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to make update rapidly?
Date: 2008-02-21 09:03:09
Message-ID: 4279588b0802210103x234af8c5gd7b49b44a652be10@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,Scott Marlowe:
Following your said:
1.Can i update the postgres's update stragety to that :when update one row
,then load all table rows to memory?
2.If do that, then mean random update 's cost(time) =order update?

On Thu, Feb 21, 2008 at 3:23 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
wrote:

> On Thu, Feb 21, 2008 at 1:07 AM, hewei <heweiweihe(at)gmail(dot)com> wrote:
> > Hi, Scott Marlowe:
> >
> > You said that " As for processing them in order versus randomly,that's a
> > common problem. "
> > do you know why? how postgres work in this scenario.
>
> Pretty much the same way any database would. it's likely that your
> data in the table is in some order. When you update one row, then the
> next n rows are read into memory as well. Updating these is cheaper
> because they don't have to be read, just flushed out to the write
> ahead log. If you have very random access on a table much larger than
> your shared_buffers or OS cache, then it's likely that by the time
> you get back to a row on page x it's already been flushed out of the
> OS or pg and has to be fetched again.
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gordon 2008-02-21 09:15:52 Re: How to make update rapidly?
Previous Message Richard Huxton 2008-02-21 08:49:37 Re: ts_headline