On Fri, May 16, 2014 at 02:25:14PM +0200, Christophe Pettus wrote:
>
>
> On May 16, 2014, at 2:22 PM, Nicolas Boullis <postgresql@ilcode.fr> wrote:
>
> > As performance matters, I am using a ThreadedConnectionPool from
> > psycopg2.pool, but I also want to have my SQL statements prepared.
>
> Why?
>
> This an honest question. In general, prepared statements do not provide significant performance improvements in
PostgreSQL.
Well, I benchmarked my webapp without prepared statements, and then
with.
Without prepared statements, I could handle around 70 requests/second.
With prepared statements, I could handle around 140 requests/second.
(And without the connection pool, I could handle around 35
requests/second.)
In my opinion, that’s a good enough reason for me to use prepared
statements.
Cheers,
--
Nicolas Boullis