ok so say your ORM-backed endpoint is fine locally and slow in production. The query log shows the same SELECT ... WHERE id = ? repeated hundreds of times per request.
locally everything feels instant cuz the test database is tiny, so nobody noticed until real data arrived. throwing a bigger database server at it seems like teh wrong answer.
Whats the standard way to fix this, and how do you stop it from creeping back in?