Book Image

Learning Heroku Postgres

By : Patrick Rafael de Oliveira Espake
Book Image

Learning Heroku Postgres

By: Patrick Rafael de Oliveira Espake

Overview of this book

Table of Contents (17 chapters)
Learning Heroku Postgres
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Keyword List
Index

Common errors


There are a number of common errors that can be easily identified through the logs. Understanding these errors and analyzing can help you in the process of continuous database improvement.

Then you will understand the most common ones so that you can take the necessary action in order to solve them.

LOG: long duration

Queries that take longer than 2 seconds are logged automatically so that you can identify and optimize your code. These logs are generated in the following format:

[8-2] g0afa5bjht [GOLD] LOG: duration: 63.697 ms statement: SELECT "courses".* FROM "courses"...

If there are large numbers of these logs, probably your application has performance problems. A good recommendation is to try to reduce the execution time of your queries by 10 ms. You can achieve this optimization by adding indexes or using the EXPLAIN command from PostgreSQL to understand the performance issues in your query.

LOG: unexpected EOF on client connection

This error occurs when your application does...