📢
7
c/fix-my-code-friday•ward.piperward.piper•1mo ago

Spent six months writing SQL queries without using JOINs properly

I was doing everything with subqueries and temp tables because I thought JOINs were slower. A senior dev looked at my code and asked why I was making things so complicated. Has anyone else realized late that they were missing a basic tool the whole time?
2 comments

Log in to join the discussion

Log In
2 Comments
skyler_white95
skyler_white951mo agoMost Upvoted
Six months? Six whole months writing queries the hard way because you thought JOINs were slow? I can't even wrap my head around that. That must have been a nightmare to debug and maintain. Subqueries and temp tables for everything sounds like pure torture. You probably spent so much time just fighting with your own code instead of getting actual work done. That senior dev must have been stunned when they finally saw your work. Good thing you found out now instead of going years like that.
10
emery965
emery9651mo ago
Gotta disagree, subqueries can be way cleaner for complex logic.
2