plpythonu+postgrs anybody using it?

Matthew Woodcraft mattheww at chiark.greenend.org.uk
Wed Apr 2 15:45:33 EDT 2008


Martin Marcher <martin at marcher.name> wrote:
> My main concern is that when things start getting more complicated
> that everytime a SP is called an instance of the interpreter ist
> started which would be a huge slowdown, so does plpythonu run
> continiously a python process or does it start one everytime a SP is
> called?

I'm not using plpythonu, but nobody else seems to be jumping to answer
so I'll have a go. I'm fairly sure but not certain that what I say
below is true.

When you use PL/Python, there is no separate Python process. The Python
interpreter is dynamically linked into each PostgreSQL back-end process
when it first calls a PL/Python function. That means that whatever the
overhead is for initialising the Python interpreter, it will be paid at
most once per database connection.

If you find that this overhead is too high, a connection pooling system
like pgpool might help.

-M-



More information about the Python-list mailing list