O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding slow SQL statements

There are two main kinds of slowness which can manifest themselves in a database.

The first kind is a single query that can be too slow to be really useable, such as a customer information query in a CRM running for minutes, a password check query running in tens of seconds, or a daily data-aggregation query running for more than a day. These can be found by logging queries that take over a certain amount of time, either at the client end, or in the database.

The second kind is a query that is run frequently (say a few thousand times a second), and which used to run in single digit milliseconds, but now is running in several tens or even hundreds of milliseconds, and is slowing down the system. This kind of slowness ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required