Home / Companies / Heap / Blog / Post Details
Content Deep Dive

Working Around a Case Where the Postgres Planner Is "Not Very Smart"

Blog post from Heap

Post Details
Company
Date Published
Author
Matt Dupree
Word Count
1,257
Company Posts That Month
5
Language
English
Hacker News Points
-
Post removed?
No
Summary

Heap, a digital insights platform, recently introduced Effort Analysis, a feature that allows users to assess the median interactions and engagement time between funnel steps. The development faced a performance challenge when scanning over a billion rows of event data, initially resulting in slower query speeds. The issue stemmed from a PostgreSQL quirk where functions and operators in the query prevented the use of an index-only scan, which is faster than a standard index scan. Heap overcame this by employing a workaround involving partial indexes, which allowed the query planner to utilize an index-only scan by matching the query predicate with the partial index predicate. This adjustment led to a twofold improvement in the p90 performance of the Effort Analysis feature. The company hopes to share these insights to help other teams optimize their PostgreSQL queries effectively.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.