7 ms·
I agree. The number of engineers who don't understand simple indexing in RDBMSes is tragic. Too many engineers see a slow query and immediately say "this databa
by aguynamedben 9y ago
I agree. The number of engineers who don't understand simple indexing in RDBMSes is tragic. Too many engineers see a slow query and immediately say "this database can't scale, let's switch databases!"
- partisan 9y agoSome go to the other extreme and add indexes on all columns without consideration for what is actually causing the performance issue. I had a former coworker who would routinely put an index on every column in a table when creating the table.
- maxxxxx 9y agoHe probably concluded that the database didn't scale because inserts were so slow :-)
- twothamendment 9y agoYes, like always there is a balance. I start off with an index on things I know we'll use and sometimes throw one a column we are likely to use. Other times it isn't until a slow query comes up that an index change is needed. On very rare occasions I've had to hint to mysql to use an index it thought wasn't great but ended up being 10 times faster.
- mrweasel 9y ago"switch database" or "buy more hardware". For the large majority of developers, then database is never the bottleneck. The issue arise when you only to late in the development process realise that your design is the root cause of your problems.
- tracker1 9y agoOr, more likely you inherited someone else's problem. Sometimes you inherit a project that's 5+ years in, and the short term solution really is, buy bigger/faster hardware. Of course some DBs are better in some use cases, and price is a factor. As is ease of replication, sharding, etc.
- dmux 9y agoThis is a great resource RE indexing: http://use-the-index-luke.com/ http://use-the-index-luke.com/