How fast is Postgres's string concatenation in comparison to the various Python 
string concatenation?  I'm using PREPARE statements for my SELECT queries for 
my web server.

I'm wondering if I should just generate my JSON API (or even HTML) strings in 
Postgres directly, instead of in Python.  This would involve a few IF-THEN-ELSE 
(in Python) which I convert to CASE-WHEN (in Postgres) as well.

I’m not sure about the internals of Postgres and how it compares speedwise to 
the Python bytecode interpreter (and future JIT compilers like PyPy).  Is 
Postgres generating bytecode and interpreting that for string concatenation & 
Case statements?


Sent via pgsql-performance mailing list (
To make changes to your subscription:

Reply via email to