Question

When SQL Server uses SQL Launchpad to launch an external runtime (e.g. R or Python) when sp_execute_external_script is used, what's the lifespan of the external runtime process?

Does each sp_execute_external_script script execution get its own external process instance or does the external process stay around until it's been inactive for a certain amount of time (e.g. the existing process might be reused if I execute another script written in the same language using the same SQL session)?

Was it helpful?

Solution

For security reasons, Python processes are not reused. Each call to sp_execute_external_script uses its own process instance(s), at least as far as Python goes.

Since Microsoft SQL Server's Python and R integrations are very similar, I'd suspect the same holds true with R, as well, but I can't say that with 100% certainty.

Reference: reddit comment made by SQL Server engineering team program manager Tobias Ternström

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top