We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Speeding up partial COUNT(*) in Postgres by using LIMIT in a subquery
Summary
Description
*Find the article on our blog here:*
https://pganalyze.com/blog/5mins-postgres-limited-count
In episode 103 of “5mins of Postgres”, we look at optimizing the performance of COUNT statements when only a subset of the data needs to be counted, through use of a LIMIT in a sub-SELECT. We also discuss how this can be represented effectively in a web application.
*Learn more about pganalyze:*
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:*
*An Efficient Way to Check for Existence of Multiple Values in SQL - Blog post by Lukas Eder*
https://blog.jooq.org/an-efficient-way-to-check-for-existence-of-multiple-values-in-sql/
Translated At: 2025-08-16T01:24:33Z