Re: Help: massive parallel update to the same table

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Red Maple" <redmapleleaf(at)gmail(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Help: massive parallel update to the same table
Date: 2011-03-18 14:28:02
Message-ID: 4D8325A2020000250003BA8D@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Red Maple <redmapleleaf(at)gmail(dot)com> wrote:

> Our system has a postgres database that has a table for statistic
> which is updated every hour by about 10K clients. Each client only
> make update to its own row in the table. So far I am only seeing
> one core out of eight cores on my server being active which tells
> me that the update is being done serial instead of being parallel.
> Do you know if there is a way for me to make these independent
> updates happen in parallel?

It should be parallel by default. Are you taking out any explicit
locks?

Also, it seems like you're only doing about three updates per
second. I would expect a single-row update to run in a couple ms or
less, so it would be rare that two requests would be active at the
same time, so you wouldn't often see multiple cores active at the
same time. (Of course, the background writer, autovacuum, etc.,
should occasionally show up concurrently with update queries.)

Is there some particular problem you're trying to solve? (For
example, is something too slow?)

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2011-03-18 14:38:05 Re: Fastest pq_restore?
Previous Message Nicholson, Brad (Toronto, ON, CA) 2011-03-18 14:23:57 Re: Help: massive parallel update to the same table