r/programming • • Apr 29 '14

Programming Sucks

http://stilldrinking.org/programming-sucks
3.9k Upvotes

1.1k comments sorted by

View all comments

Show parent comment

2

u/PstScrpt Apr 30 '14

Here's one I put in real production code (a 2700 line SQL view):

-- This is obnoxious, but the real TransDateTime is more likely to need a key lookup.

That was reconstructing a value that's already in the table, but not in the index this subquery was going to hit.