Re: Low Performance for big hospital server ..

From: William Yu <wyu(at)talisys(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Low Performance for big hospital server ..
Date: 2005-01-06 03:31:10
Message-ID: cribhc$262i$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

amrit(at)health2(dot)moph(dot)go(dot)th wrote:
> Now I turn hyperthreading off and readjust the conf . I found the bulb query
> that was :
> update one flag of the table [8 million records which I think not too much]
> .When I turned this query off everything went fine.
> I don't know whether update the data is much slower than insert [Postgresql
> 7.3.2] and how could we improve the update method?

UPDATE is expensive. Under a MVCC setup, it's roughtly the equivalent of
DELETE + INSERT new record (ie, old record deprecated, new version of
record. Updating 8 million records would be very I/O intensive and
probably flushes your OS cache so all other queries hit disk versus
superfast memory. And if this operation is run multiple times during the
day, you may end up with a lot of dead tuples in the table which makes
querying it deadly slow.

If it's a dead tuples issue, you probably have to increase your
freespace map and vacuum analyze that specific table more often. If it's
an I/O hit issue, a lazy updating procedure would help if the operation
is not time critical (eg. load the record keys that need updating and
loop through the records with a time delay.)

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Ben Bostow 2005-01-06 08:02:49 Problems with high traffic
Previous Message Miles Keaton 2005-01-06 02:31:49 Benchmark two separate SELECTs versus one LEFT JOIN