Re: Parallel Scaling of a pgplsql problem

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>, "Venki Ramachandran" <venki_ramachandran(at)yahoo(dot)com>
Subject: Re: Parallel Scaling of a pgplsql problem
Date: 2012-04-25 20:04:45
Message-ID: 4F98128D0200002500047377@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Venki Ramachandran <venki_ramachandran(at)yahoo(dot)com> wrote:

> I have PostGres 9.0 database in a AWS server (x-large) and a
> pgplsql program that does some computation. It takes in a date
> range and for one pair of personnel (two employees in a company)
> it calculates some values over the time period. It takes about
> 40ms (milli seconds) to complete and give me the answer. All good
> so far.

Maybe; maybe not. If you wrote out *how to do it* in your code, it
probably won't scale well. The trick to scaling is to write
*declaratively*: say *what you want* rather than *how to get it*.

Aggregates, window functions, CTEs, and/or the generate_series()
function may be useful. It's hard to give more specific advice
without more detail about the problem.

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2012-04-25 20:09:26 Re: Parallel Scaling of a pgplsql problem
Previous Message Samuel Gendler 2012-04-25 19:36:25 Re: Parallel Scaling of a pgplsql problem