fioprotocol / fio-registrations

FIO protocol domain and address registration
MIT License
5 stars 9 forks source link

two final optimizations #47

Closed blockpane closed 4 years ago

blockpane commented 4 years ago

These are the last two queries seriously affecting performance. One was being generated by sequalize and I converted that to a raw query, which also required some small changes to variable names for pendingAccounts.

Both queries were running for over 30 seconds on a test db with only around 20k registrations, now they return in under 500ms. No more WARN: process event overlap within PROCESS_EVENTS_MS 10000 errors. For the most part the optimizations are using common table expressions to reduce looping and the number of full table scans.