These code examples are from the ChickTech Workshop on finding and fixing database N+1 issues. Attendees built a few quick Node.js apps to make sure all the pieces (Node, Postgres, New Relic) were installed and working properly.
We used a typical hello world example from the Internet as a starting point.
Attendees downloaded an app with a deliberately added slow database query, then diagnosed and fixed the N+1 problem causing it.