Re: Parallel updates on multiple cores

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Andrei <andrei_view(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Parallel updates on multiple cores
Date: 2008-06-09 14:25:08
Message-ID: 1213021508.12046.104.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.com
PostgreSQL Training, Services and Support

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Eshom 2008-06-09 16:05:52 Unable to create function which takes no arguments
Previous Message Shane Ambler 2008-06-09 10:29:58 Re: Parallel updates on multiple cores