Re: pl-sql

From: "Dr(dot) Evil" <drevil(at)sidereal(dot)kz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pl-sql
Date: 2001-07-19 02:05:07
Message-ID: 20010719020507.11840.qmail@sidereal.kz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


pl/pgsql can give a real boost if you need to aggregate values in a
way that doesn't have an existing SQL function. For instance, there
is an SQL function which will take an average. However, what if you
need some other statistical type of average which isn't supported in
SQL? For the sake of an example, let's say that median isn't
supported in SQL (it may be, I haven't checked). If you need to take
the median of 10000 rows, it will be very slow if you do all that on
the client. It will be much faster to write median in pl/pgsql and
just do it on the srver.

Also, pl/pgsql queries get optimized before they are run, so there is
some benefit there, too.

In response to

  • pl-sql at 2001-07-19 09:51:35 from Aarmel

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-07-19 02:42:00 RPM source files should be in CVS (was Re: psql -l)
Previous Message Martijn van Oosterhout 2001-07-19 01:55:56 Re: slow SELECT ... LIMIT query