Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Oleg Serov <serovov(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;
Date: 2008-11-17 18:04:45
Message-ID: 1226945085.11131.22.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2008-11-17 at 12:37 -0500, Andrew Dunstan wrote:
>
> Hannu Krosing wrote:
> > On Sun, 2008-11-16 at 23:20 +0300, Oleg Serov wrote:
> >
> >> Wee need to use shared memory for passing one BIGINT value(is session
> >> throwout triggers), can you advice the method to get/set it with best
> >> performance ?
> >>
> >
> > have you tried "setval(seq, value)" to set and "select last_value from
> > seq" to read it.
> >
> > or just use a table, if concurrency control is important
> >
>
> Neither of these would be the same as using plperl's %_SHARED, which I
> gather is what is being done.

He asked for a method to get/set a shared value "with best performance"
and updating a table row seems about twice as fast as calling a plperl
function.

> But using a temp table would be.

You can't access temp table from several sessions, which is what I think
they want.

--
------------------------------------------
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-11-17 18:13:12 Re: Updates of SE-PostgreSQL 8.4devel patches (r1197)
Previous Message Tom Lane 2008-11-17 17:57:26 Re: Pl/Perl function: Speed of the First time executing pl/perl function in connection;