Chapter 10. Performance and Concurrency

In this chapter, we will cover the following recipes:

  • Finding slow SQL statements
  • Collecting regular statistics from pg_stat* views
  • Finding out what makes SQL slow
  • Reducing the number of rows returned
  • Simplifying complex SQL queries
  • Speeding up queries without rewriting them
  • Why a query is not using an index
  • Forcing a query to use an index
  • Using optimistic locking
  • Reporting performance problems

Introduction

Performance and concurrency are two problems that are often tightly coupled—when concurrency grows, performance usually degrades, in some cases a lot. If you take care of performance problems, you can achieve better concurrency.

In this chapter, we will show you how to find slow queries and also how to find queries ...

Get PostgreSQL 9 Administration Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.