I vividly remember a case where a really simple page in a system had become incredibly slow - on asking what had changed I was told "all we did was add a count of the number of users".
Turns out the back end (they were micro-services - even though the term hadn't been invented at that point) didn't have a call for "total number of users" so the front end code (this was server side HTML generation - 10+ years ago) was getting a list of every user in the system and iterating over all of them in chunks and counting.
Turns out the back end (they were micro-services - even though the term hadn't been invented at that point) didn't have a call for "total number of users" so the front end code (this was server side HTML generation - 10+ years ago) was getting a list of every user in the system and iterating over all of them in chunks and counting.