
As I was going through a trace to look for speedup opps I've realized 90% of our latency exists in a single sql query:
SELECT * FROM request_for_quotes WHERE status IN (5,6,7)
This query is called in GetCommittableBalances which is called in HasSufficientGas which in turn is called twice sequentially (#2960).
Amazingly, it's then called a third time in forward-Seen:
Moving on to forward-ComimttedPending we call it 2x more sequentially
Then again in 2x more in forward-CommittedConfirmed:

As I was going through a trace to look for speedup opps I've realized 90% of our latency exists in a single sql query:
SELECT * FROMrequest_for_quotesWHERE status IN (5,6,7)This query is called in GetCommittableBalances which is called in
HasSufficientGaswhich in turn is called twice sequentially (#2960).Amazingly, it's then called a third time in
forward-Seen:Moving on to forward-ComimttedPending we call it 2x more sequentially
Then again in 2x more in forward-CommittedConfirmed: