From: Bobby Mozumder <bmozumder@gmail.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Should I generate strings in Postgres of Python?
Date: Tue, 18 Oct 2016 16:35:20 -0400
Message-ID: <964DB65A-9A61-42EF-9803-5CE99F564727@gmail.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
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?
-bobby
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: bmozumder@gmail.com
Subject: Re: Should I generate strings in Postgres of Python?
In-Reply-To: <964DB65A-9A61-42EF-9803-5CE99F564727@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox