Why is Postgres on RDS maxing out on CPU every few hours?
It was a combination of making too many transactions and too many functions. After combining statements into the same transactions and removing the functions, the CPU hasn't risen past an average of 5%.