Hacker News new | past | comments | ask | show | jobs | submit login

99% of the time, it's either a quadratic (or exponential) algorithm or a really bad DB query.



can also be a linear algorithm that does N+1 queries. ORMs can be very good at hiding this implementation detail


> a linear algorithm that does N+1 queries.

That's what quadratic means.


Typically implemented accidentally: https://www.tumblr.com/accidentallyquadratic


No, N+1 is still linear.



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: