Skip site navigation (1) Skip section navigation (2)

Re: Parallel Function calls using multiple processes

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Vishal Gupta <vishal(dot)g(at)pinelabs(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Parallel Function calls using multiple processes
Date: 2009-12-16 07:34:48
Message-ID: 162867790912152334h31be298cu2729738ea9539729@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
2009/12/16 Vishal Gupta <vishal(dot)g(at)pinelabs(dot)com>:
> Problem: Function call typically takes 2-3 millisecond but at times
> exceeding 2-3 Minutes.
> =====================================================
> From the DB logs it seems when multiple processes are trying to execute the
> function,
> execution takes sequentially rather than parallel, which means Nth thread
> will have to wait for (N-1)*ExecutionTime before getting its turn

it's depend - if there are some locks then yes.

but reason could be a slow query inside procedure too - look on
pg_stat_activity table, if there are processes waiting for lock.

see http://old.nabble.com/Query-is-slow-when-executing-in-procedure-td26490782.html

Regards
Pavel Stehule


>
> Is my observation correct? If yes then what is the solution for this? If not
> where/how to find the exact cause of the above problem?
> =====================================================
> DB Version: 8.2
> Function Details:
> --returns numeric, takes 10 parameters
> --select query to validate data
> --row level lock for select and validate
> --bare minimum business logic
> --update data
> --couple of inserts for transaction logs/account management
> --also note that few of the tables have audit triggers causing the row to be
> inserted in audit table with the action (only Update/Insert/Delete)
>
>

In response to

pgsql-performance by date

Next:From: Vishal GuptaDate: 2009-12-16 08:17:01
Subject: Re: Parallel Function calls using multiple processes
Previous:From: Vishal GuptaDate: 2009-12-16 06:46:36
Subject: Parallel Function calls using multiple processes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group