This rails app creates a database with the teams from the 4 major American sports leagues: NFL, NBA, MLB, and NHL.
Once the database has been migrated, a speed check for a number of different ActiveRecord queries can be run. The commands return the 10 sports teams located in the state of New York (and yes, I’m including the Giants and Jets).
The rake command for this speed check is “rake speedcheck:queries”. This command uses benchmark to measure the speed of the queries written, which include the following:
.all.each (2 different queries) .includes .joins .eager_load .preload