Dramatic improvement by replacing ActiveRecord loop with single SQL query

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

Autovist’s worker process started producing hundreds of Heroku R14 “memory quota exceeded” errors:

But we haven’t added any new jobs recently.  What’s going on?

Continue reading “Dramatic improvement by replacing ActiveRecord loop with single SQL query”

Converting postgres time zones

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

I’ve always found working with time zones to be a bit confusing.  Here is a simple way to convert from UTC to any time zone.

Continue reading “Converting postgres time zones”

Keeping the Autovist Dashboard Fast… and a surprise discovery

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

While performance tuning the database to solve Dashboard timeouts, we made a surprise discovery about how tweets and their embedded URLs are actually being used.

Continue reading “Keeping the Autovist Dashboard Fast… and a surprise discovery”

Adding index reduces query from 80 seconds to less than half a second

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

After bringing the production database down to my local dev machine and restoring it in order to use the latest data to develop against, I could no longer load the Dashboard for my @VaxCalc account as it kept timing out. Autovist has posted more than 25,000 tweets for @VaxCalc tracking multiple broadcasts of each tweet, url clicks and RTs for each of the broadcasts. Was this large number of tweets killing performance somehow?

Continue reading “Adding index reduces query from 80 seconds to less than half a second”