Efficient Database Tasks
Learned about generating a rolling revenue windows for a user and I was taught a few points I didn’t consider at first:
- It’s important to efficiently implement work on the database (especially if there are a lot of rows!)
- Operations like
#update_allapply to the entire db and are much more efficient because they doing go through every row.
- When finding a rolling revenue (ie 12 months) for a customer, an efficient
implementation could include:
- only write in rows that actually have revenues > 0 for that 12 month period
- be sure to do this daily when there isn’t much activity for reliable data
We had a bit of a celebratory tasting for another release of our high end chardy, Mimi.
I haven’t been blogging as much, but I figure I should get back into it.