Thread: pl/pgSQL versus pl/Python

pl/pgSQL versus pl/Python

From
"Joshua D. Drake"
Date:
Hello,

With the new preload option is there any benefit/drawback to using
pl/Python versus
pl/pgSQL? And no... I don't care that pl/Python is now considered untrusted.

Sincerely,

Joshua D. Drake

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL


Re: pl/pgSQL versus pl/Python

From
Joe Conway
Date:
Joshua D. Drake wrote:
> With the new preload option is there any benefit/drawback to using
> pl/Python versus pl/pgSQL?

If you're asking about relative speed, I did some *very* simple tests
and posted them here:

http://archives.postgresql.org/pgsql-patches/2003-07/msg00239.php

without preload:
=====================================================================
regression=# explain analyze select echo_plperl('hello');
  Total runtime: 55.29 msec
regression=# explain analyze select echo_pltcl('hello');
  Total runtime: 23.34 msec
regression=# explain analyze select echo_plpythonu('hello');
  Total runtime: 32.40 msec
regression=# explain analyze select echo_plpgsql('hello');
  Total runtime: 3.09 msec


with preload:
=====================================================================
regression=# explain analyze select echo_plperl('hello');
  Total runtime: 5.14 msec
regression=# explain analyze select echo_pltcl('hello');
  Total runtime: 7.64 msec
regression=# explain analyze select echo_plpythonu('hello');
  Total runtime: 1.91 msec
regression=# explain analyze select echo_plpgsql('hello');
  Total runtime: 1.35 msec

This was intended to just measure the time to execute a simple "hello
world" type of function, for the first time in a given session. I did
not repeat/average the results though, so you might want to do some of
your own testing.

Joe