python modul pre-import to avoid importing each time

From: Rémi Cura <remi(dot)cura(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: python modul pre-import to avoid importing each time
Date: 2014-06-24 07:22:48
Message-ID: CAJvUf_ssimnOdJ39sianv76Lz6aep+jbgVB7T0b4W1ypbsc_SA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hey List,
this is a repost from the general list where it get no responses (5 days)

I use plpython with postgis and 2 python modules (numpy and shapely).
Sadly importing such module in the plpython function is very slow (about
half a second).

I also don't know if this overhead is applied each time the function is
called in the same session.

Is there a way to pre-import those modules once and for all (at server
start up for example),
such that the python function are accelerated?

Thanks,

Cheers,
Rémi-C

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2014-06-24 07:30:44 Re: inherit support for foreign tables
Previous Message Soroosh Sardari 2014-06-24 07:02:01 Re: Add a filed to PageHeaderData