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

> It's really not very hard, basically add indexes

It's really not but you'd be surprised how many people don't know the basics of how indexes work. I've had people tell me that their queries couldn't be optimized further because "they had already added an index for every column of the table".

It doesn't help that SQL, by design, hides the actual algorithm doing the data access from the users while simultaneously relying on them to add indexes to achieve performance, which is in my humble opinion the worst mistake of SQL.




That is not a SQL mistake, but an implementation choice. Most modern databases can determine where indexes should be added, and add these automatically. E.g.: https://www.oracle.com/news/connect/oracle-database-automati...


This is news to me. Can any other DBs do this?

(I only skimmed -- far too much "Joan explains that" to signal ratio.)



Not for postgres or mysql.


I love to ask this very simple question in interviews: if a database index makes queries faster, why not add an index for every column on a table?

I want them to say “the heck are you talking about, because that’s not how anything works?”… it does trip some people up though that just legitimately don’t understand what’s happening.




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

Search: