plpythonu+postgrs anybody using it?

M

Martin Marcher

Hello,

I just started on working with a postgres project, the DB looks really
bad and isn't normalized in any way... 4k Text messages representing a
whole protocol which need to be transformed. Somehow it just doesn't
seem right to put this stuff directly in the database and creating a
bunch of stored procedures (SP) to parse them but I'm not the one to
decide it...

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?

--
http://tumblr.marcher.name
https://twitter.com/MartinMarcher
http://www.xing.com/profile/Martin_Marcher
http://www.linkedin.com/in/martinmarcher

You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.
 
M

Matthew Woodcraft

Martin Marcher said:
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-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top