Heap is an analytics tool that captures all user interactions on a website, logging every event such as clicks, page views, and form submissions. This comprehensive data collection allows website owners to define and query specific events, like logins, using PostgreSQL's partial indexes. These indexes are created based on defined events and enable fast querying of historical data, facilitating complex analyses like conversion funnels. Despite the efficiency of partial indexes, Heap faces challenges due to the CPU-intensive nature of maintaining millions of indexes, the limitations of PostgreSQL's concurrent index creation, and the need to defer data writing during index creation processes. By leveraging these partial indexes, Heap can manage vast amounts of data swiftly and effectively, though the infrastructure demands significant computational resources for index maintenance.