A different source of waiting
AI workflows still need ordinary application work: finding conversations, checking quotas, loading history, and writing records. Optimizing model response time cannot remove a database bottleneck.
What we changed in AnythingLLM
The local experiment introduced a covering index shaped around the quota and history queries. An index organizes the fields a query uses so the database can find matching entries without repeatedly scanning unrelated chat records. Covering the selected fields can also avoid additional table lookups.
The measured scope
Across the large local fixture comparisons, the quota query took 92.8–98.5% less time. That figure belongs to that query and those fixtures. It is not a whole-chat speedup, an LLM saving, or evidence of lower hosting bills.
The diagnostic approach
Break a user action into stages and measure each one on representative data sizes. Fix the part that consumes time, then rerun the complete action. This keeps an impressive microbenchmark from becoming an unsupported promise about the product.