If you want advice on common performance scale issues, Shayon Mukherjee’s list of problems & solutions is beautifully concise. Seriously, it’s good and straight to the point.
If you need to purge data from a large table, Shayon explains how to use Postgres’s built-in CTID to roll through rows based on their physical location.
If you use AWS Aurora Postgres, your queries may avoid indexes because they don’t understand how smokin’ fast AWS’s storage is for random reads, and Shayon has an easy fix. You’ll have noticed a theme here: all of this week’s links are by Shayon Mukherjee, and if you like them, you should check out Shayon’s full list of past posts.
As you scale to multiple terabytes, you may find that the overhead of foreign keys isn’t worth their diminishing payoff for mature code bases. Again, we’re specifically talking about mature code bases – your brand new app & database definitely still needs foreign keys for the first couple/few years.
