Hacker News new | ask | show | jobs
by candiodari 3183 days ago
This is how enterprise developers use the database, sometimes:

https://thedailywtf.com/articles/The-Query-of-Despair

You do this on your own server, slowness and bad performance are the result (but it may never, or very rarely get called). You do it on dynamo, a $10k bill may be the result.

2 comments

That's not quite true. With DynamoDB, you provision capacity, so by default, it will simply get slow (throttled) if you use more than you expect.

The only way you could be "surprised" with a $10k bill is if you set up autoscaling for it with your upper limits (which it requires you to choose) high enough to reach $10k. And then you'd have to forget that you did that.

Formatting is obviously an issue but the query length isn't a sign for bad programming. I've created some queries that probably have nearly that length. They filter, join and prepare data in ways that would probably need as much LOC in other languages while running much faster (as the database server can better optimise for structures). In this case there obviously was a problem but it could've been that someone changed an index in one table which then affected the query.

But I agree, I also don't like running databases billed by load. The risk of costly bugs is just too high.