I have a web application presenting data that is generated by a separate process and stored in PostgreSQL, version 8.4. The backend writes continuously enough, but most views in a web application only execute read-only SELECT queries.
According to the New Relic Python agent, 30% of the processing time for my view was spent completing the completion of COMMIT, and this is especially bad in views that returned a large number of SELECT queries, even if they did not modify any data.
I expected that a read-only transaction should have very little work during the commit phase. What is Postgres doing during COMMIT for these read-only requests?
I know that I can turn off synchronous_commit for these transactions to hide latency from the view, and I certainly donβt care about the read-only transaction longevity, but I donβt understand why this is necessary, and I am worried that it might mask deeper wrong configuration.
source share