Re: Parallel updates on multiple cores - Mailing list pgsql-sql

From Simon Riggs
Subject Re: Parallel updates on multiple cores
Date
Msg-id 1213021508.12046.104.camel@ebony.site
Whole thread Raw
In response to Parallel updates on multiple cores  (Andrei <andrei_view@yahoo.com>)
List pgsql-sql
On Mon, 2008-06-09 at 01:29 -0700, Andrei wrote:
> The function above updates the rows between the ids start_id and
> end_id.
> I have a quad core procesor so i run two separate connections to the
> database: select populate_test_data(5000,1) and another select
> populate_test_data(5000,2). In this case each function runs on one
> core doing the inserts in parallel, but when i try to run select
> select_unprocessed(1,5001) and from another connection select
> select_unprocessed(5001, 10001), one of the processes locks the table
> so the other one has to wait until the table is unlocked.
> Each process updates different parts of the table.

Your ranges overlap. So one waits for the other on tuple=5001.

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-sql by date:

Previous
From: Shane Ambler
Date:
Subject: Re: Parallel updates on multiple cores
Next
From: Michael Eshom
Date:
Subject: Unable to create function which takes no arguments