Re: Psycopg and prepared SQL statements
От | Nicolas Boullis |
---|---|
Тема | Re: Psycopg and prepared SQL statements |
Дата | |
Msg-id | 20140516123421.GD3668@tryphon.debian.net обсуждение исходный текст |
Ответ на | Re: Psycopg and prepared SQL statements (Christophe Pettus <xof@thebuild.com>) |
Список | psycopg |
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
В списке psycopg по дате отправления: