36
myss
7y

Spend several days decoding API legacy code from the guy who got paid shitload of money and then stumble on the piece of code that shows he isn't even aware there is a count function in SQL (or rowCount in PDO)

:)))))

Comments
  • 0
    Damn N + 1
  • 6
    And the query is executed in a loop :/
  • 5
    Who needs performance these days. It's some kind of an old stuff, right? Nobody cares...
  • 2
    If you execute your raw sql, and it gives you back more bytes than you need for the final result, you're doing it wrong.

    A little bit of formatting & transformation in the backend code is all fine, but the select should not give you bulk data you're not going to use.
Add Comment