News for hackers. Stuff that matters.
Re:WebSockets cost us $1M on our AWS bill by antisthenes on Wednesday November 06, 2024 @05:40PM (#42070679)
99% of the time, it's either a quadratic (or exponential) algorithm or a really bad DB query.
Re:WebSockets cost us $1M on our AWS bill by dd82 on Wednesday November 06, 2024 @06:02PM (#42070922)
can also be a linear algorithm that does N+1 queries. ORMs can be very good at hiding this implementation detail
Re:WebSockets cost us $1M on our AWS bill by Quekid5 on Wednesday November 06, 2024 @07:04PM (#42071567)
> a linear algorithm that does N+1 queries.

That's what quadratic means.

Re:WebSockets cost us $1M on our AWS bill by sgerenser on Wednesday November 06, 2024 @07:58PM (#42072056)
Typically implemented accidentally: https://www.tumblr.com/accidentallyquadratic
Re:WebSockets cost us $1M on our AWS bill by jon_richards on Wednesday November 06, 2024 @09:27PM (#42072666)
Re:WebSockets cost us $1M on our AWS bill by nwellnhof on Thursday November 07, 2024 @01:11PM (#42079211)
No, N+1 is still linear.
Re:WebSockets cost us $1M on our AWS bill by DylanSp on Thursday November 07, 2024 @10:55AM (#42077743)
It wasn't a financial cost, but the biggest single performance improvement I've seen firsthand came from optimizing a SQL query. One of our Professional Services people had written a query that did repeated self-joins on a fairly large table, which took ~15 minutes to run. A DBA-turned-dev on our team rewrote it using MSSQL's PIVOT operator, and the query started executing in less than a second.