Tuesday November 18, 2025

# Projects

# Cash Movement Report

Performance is poor on production and it doesn't seem related to notes search. (~10 seconds to load the report for a retailer with only like 10 rows of data) I'm going to investigate the queries being run and see if there are any optimizations I can make. Dania also noticed some weird behavior on first load where there are some 0 value rows rendered before the actual data shows up.

  • Spent the day profiling and optimizing the queries.
    • Added retailer hash to query to use retailer partitioning.
    • Pushed date filtering earlier in the query to reduce data set size.
    • Implemented 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