Technical Paper

Indexing and scaling

5.12 Indexing and scaling

The system of record is a single managed Postgres instance (Neon) with conventional B-tree indexes; separate branches serve development and production. Representative index classes:

TableIndexUse
receiptsuser + upload timeList a user's receipts
receiptsmerchant + upload timeMerchant history
receipt_line_itemscanonical productPrice history reads
price_epoch_observationsepoch + leaf indexEpoch reads and inclusion proofs
contribution_point_eventsuser + creation timeBalance queries
merchantstax id + country (unique, partial)Merchant identity resolution

Time-based partitioning of receipts and receipt_line_items and movement of older data to a lower-cost analytics layer are scaling options for when volume warrants them; the current volume is served by the single instance and conventional indexing. The specific engine tuning stays in the internal operations layer.