Advantages of Indices Solution – Web Development

Advantages of Indices Solution – Web Development


And the correct answer is indexes increase the speed of database reads. Yes, that is true. That is what they are used for, at least. Sometimes you don’t make the right index, but assuming you made the correct index, your index matches your query, yes, you will increase the speed of reads. At least you hope so. Indexes increase the speed of database inserts. No, that is false. They probably decrease the speed of database inserts. That is because when we’re inserting a new round to our table, we probably also have to update all of our indexes, and that takes time. So there’s a tradeoff. We can probably get faster reads at the expense of slower inserts. And probably slower writes in general, for just updating a row, but there’s actually a few perverse cases where an index can actually increase the speed of an update. Let me give you a little real demo of how indexes can affect things in the real world.

Be the first to comment

Leave a Reply

Your email address will not be published.


*