pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua Tolley <eggyknap@gmail.com>
To: c k <shreeseva.learning@gmail.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] plpyhton
Date: Wed, 24 Nov 2010 22:42:55 -0700
Message-ID: <4cedf777.2a978e0a.619c.164d@mx.google.com> (raw)
In-Reply-To: <AANLkTikk1YBMFwiVg8UvX1vEmC0yxqYpO0z-H=8dyNxX@mail.gmail.com>
References: <AANLkTimo61d+_oEaX_3S=Lby=YJGP=ca0UC3XEFyfVNk@mail.gmail.com>
	<AANLkTikk1YBMFwiVg8UvX1vEmC0yxqYpO0z-H=8dyNxX@mail.gmail.com>

On Wed, Nov 24, 2010 at 11:56:16AM +0530, c k wrote:
> Hello,
> Does calling a pl/python function from each database connection load the
> python interpreter each time? what are the effects of using pl/python
> function in a environment where no. of concurrent connections are more and
> each user calls a pl/python function?
> 
> Please give the details about how pl/python functions are executed.
> Thanks and regards,
> 
> CPK

I don't know plpython terribly well, but for most PLs, calling them once in a
session loads any interpreter they require. That interpreter remains loaded
for the duration of the session. So each individual connection will load its
own interpreter, once, at the time of the first function call requiring that
interpreter. Most widely used languages also cache various bits of important
information about the functions you run, the first time you run them in a
session, to avoid needing to look up or calculate that information again when
you run the function next time.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Attachments:

  signature.asc (application/pgp-signature, 196B) download

view thread (9+ messages)  latest in thread

Message-ID: <4cedf777.2a978e0a.619c.164d@mx.google.com>
Permalink:  ../4cedf777.2a978e0a.619c.164d@mx.google.com/
Also on:    postgresql.org/message-id/4cedf777.2a978e0a.619c.164d@mx.google.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: eggyknap@gmail.com, shreeseva.learning@gmail.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] plpyhton
  In-Reply-To: <4cedf777.2a978e0a.619c.164d@mx.google.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox