blocktogether icon indicating copy to clipboard operation
blocktogether copied to clipboard

Don't insert blank TwitterUsers on every updateBlocks

Open jsha opened this issue 11 years ago • 0 comments

Right now every time updateBlocks is called, it makes a call to insert a large number of TwitterUsers by uid so additional data can be picked up by updateUsers. This is an INSERT IGNORE call so it won't overwrite, but it's presumably somewhat expensive to build the call and send it to MySQL. Alternatives:

  • Keep an in-memory cache in update-blocks.js of recently-seen uids.
  • Trigger the TwitterUsers insert only on first time calling updateBlocks for a new user AND when diff between blockBatches shows a new external block action, i.e. the only times when new uids show up in the system.

jsha avatar Nov 15 '14 05:11 jsha