postgresqlperformanceautocommit

PostgreSQL Autocommit efficiency on SELECT queries


I am using Psycopg2 to issue many SELECT queries to my Postgres DB. These queries have a small size result and they are sent at a high frequency.

In order to avoid managing transactions myself (because I'm lazy), I have set autocommit = True in the session settings.

Edit: there is no long pause between queries, no data manipulation, and the cursor gets closed immediately after I stop making queries.

I would like to know: When issuing SELECT queries at a high frequency, is there any performance penalty of using autocommit?

Using Postgres 9.6 and Psycopg 2.7.7. And yes, I am using prepared statements.


Solution

  • Autocommit is the right thing because: