[英]How is PL/Python code executed by Postgresql
当执行 PL/Python 过程时,python 代码由 Python 解释器执行。 我的问题是,Python 解释器是作为单独的进程运行,还是链接到调用数据库进程的共享库?
我担心当我们调用类似 plpy.execute(...) 时会发生什么。 If the python interpreter is running as a separate process I imagine there would be a lot of overhead involved in passing the result of the sql query back to the python interpreter, which would require reading from a file or pipe.
语言处理程序 function ( plpython3_call_handler plpython3_call_handler()
) 将plpython3.so
库加载到 PostgreSQL 进程中,该进程链接到libpython3.so
。 所以解释器被加载到后端,它不是作为一个单独的进程执行的(PostgreSQL 客户端后端不允许多处理/多线程,并行工作者除外)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.