Stack Overflow Makes Slow Pages 100x Faster By Simple SQL Tuning 
Remember 10 years ago when this was a solved problem?  There were only two rules: "always use stored procedures" and "never build dynamic SQL".  Doing stuff on relational databases was fast.Granted, you often had to actually write Stored Procedures by hand back then.  But then if you look at the LINQ in the article, you'll notice that it's pretty much exactly the SQL you'd stick into your stored procedure, just backwards.  Had they not bothered introducing LINQ in the first place, they'd have had their 100x performance boost from the get go.Naturally, SP's are not some magic 100x'ing cure-all.  They're just a non-generated version of your SQL, which means that you're guaranteed never to have your ORM go nuts and build some monstrosity like the one outlined in the article.You still need to tune your SQL by hand, but at least you can tune the SQL rather than some not-particularly-helpful abstraction on top of it.