How to optimize correlated subqueries in Postgres

Author: pganalyze
Published At: 2023-07-13T00:00:00
Length: 06:10

Summary

Description

*Find the article on our blog here:* https://pganalyze.com/blog/5mins-postgres-optimize-subqueries

In episode 76 of “5mins of Postgres”, we are going to talk about how to optimize subqueries in Postgres by understanding the Postgres planner better. We look at correlated vs. uncorrelated subqueries, as well as scalar subqueries vs. tabular subqueries.

*Learn more about pganalyze:*

https://pganalyze.com

https://pganalyze.com/newsletter

https://twitter.com/pganalyze/

*Check out the pganalyze library for eBooks, webinars, and more:*

https://pganalyze.com/resources

📑 *What we have discussed in this episode of 5mins of Postgres:*

*Subqueries and performance in PostgreSQL - by Laurenz Albe*

https://www.cybertec-postgresql.com/en/subqueries-and-performance-in-postgresql/

*Laurenz Albe on GitHub*

http://localhost:8000/blog/5mins-postgres-optimize-subqueries

*The Basics of Postgres Query Planning*

https://pganalyze.com/docs/explain/basics-of-postgres-query-planning

*How Postgres Chooses Which Index To Use For A Query*

https://pganalyze.com/blog/how-postgres-chooses-index

*Webinar Recording: How to use the Postgres query planner to debug bad plans and speed up queries*

https://www.youtube.com/watch?v=nVhLTwVefCA

*Postgres performance with IN vs ANY*

https://pganalyze.com/blog/5mins-postgres-performance-in-vs-any

Translated At: 2025-08-18T13:17:38Z

Request translate (One translation is about 5 minutes)

Version 3 (stable)

Optimized for a single speaker. Suitable for knowledge sharing or teaching videos.

Recommended Videos