PostgreSQL aggregates and hyperfunctions' design is centered around enhancing developer experience. The PostgreSQL aggregate API works row-by-row, storing state about previous rows and updating it as new rows are seen. This can lead to performance issues if not optimized. To address this, TimescaleDB's two-step aggregation design pattern was developed, which separates the aggregate function from its accessor, allowing for better optimization and logical consistency in re-aggregation. This approach enables features such as deduplication, rollups, and retrospective analysis of downsampled data, making it easier for developers to work with large datasets. The design also allows for flexibility in continuous aggregates, enabling users to modify parameters without recalculating old states.