re: SQL 201: 10 Ways to Tweak Slow Running Queries VIEW POST


Thank you James :)

I'm also finding it really hard to untangle nested views right now. I know there is a column I need from somewhere down through the spaghetti mess but it's getting harder and harder to split that out from the noise around it.

I'm learning more and more that it's important to reassess why views are important and if they are so important, why they aren't a table in their own right.

The more I delve into databases in the real world the more pragmatic I become, but at the same time know things could be better


I think that's exactly why more senior devs tend to lean on the "keep it really simple" side of the spectrum. We've had first-hand experience with what happens when you don't!

I find most times the culprit is an attempt to make everything "re-usable". But whether it's database code or back-end code, etc. that's a principle that shouldn't be pushed so hard.

I'd much rather deal with the same logic copied and pasted in 3 different places than 3 levels of nested views, etc.

code of conduct - report abuse