O'Reilly logo

PostgreSQL High Performance Cookbook by Dinesh Kumar, Chitij Chauhan

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

Chapter 11. Query Optimization

In this chapter, we will cover the following recipes:

  • Using sample data sets
  • Timing overhead
  • Studying hot and cold cache behavior
  • Clearing the cache
  • Querying plan node structure
  • Generating an explain plan
  • Computing basic costs
  • Running sequential scans
  • Running bitmap heap and index scans
  • Aggregate and hash aggregate
  • Grouping
  • Working with set operations
  • Running a CTE scan
  • Nesting loops
  • Working with merge and hash join
  • Working on semi and anti joins

Introduction

When an end user submits an SQL query to a database, in general any database engine does the parsing and then validates the syntax and semantics of the given query. Once the query passes through the parsing levels, it will enter into the optimizer section. This optimizer section ...

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