Scaling in the early days

Your app. is slow because your queries are slow.

In the early days, there are only two or three things you should do to scale your application (generally speaking).

  1. Add more cores and memory to the server
  2. minify assets css/js.
  3. index your queries.

But really, your app. is slow because your queries are slow.

Adding the right index made this query 11 times faster. Down to 74 millisecond from 944 milliseconds. Look at this beautiful query plan.

Don't get me started on what these queries do to your throughput.