Projects
Production performance for the Cash Movement Report was unacceptable. It took around 10 seconds to load for a retailer with only about 10 rows of data, and the issue didn't appear related to notes search. Dania also noticed phantom zero-value rows rendering on first load before the real data appeared.
Spent the day profiling and optimizing the BigQuery queries. I added the retailer hash to the query so it can leverage retailer-based partitioning, pushed date filtering earlier in the query to reduce the working data set, and implemented an aggregate-optimized query path.
Performance Results
| Metric | Before | After | Improvement |
|---|---|---|---|
| Elapsed Time | 9 sec | 752ms | 12x faster |
| Slot Time | 2hr 7min | 51 sec | ~150x reduction |
| Rows Scanned | 96M | 71K | 99.9% reduction |