It is known that if on the field by which you often make a SELECT hang an index of type INDEX , then the selection from the base will occur several times faster. But also on the forums they write that with this increases the time of INSERT , UPDATE requests, because need to update the index. This is all clear and no complaints. :)

The question is, does the time of INSERT , UPDATE queries increase, if the field on which the INDEX type index is set does not change during these queries?

PS I hope the essence of the question is clear :)

    1 answer 1

    Yes, because the index is not one field, but a bunch of fields. If at least something in the bundle changes, the index is updated. The fact that now in apartment 123 not Ivanov lives now, but Petrov will make him change a bunch of documents.

    True for most projects, the difference is insignificant. Check is easy: create a table with 10k records. And look at the average time of these operations with one / two / three index

    • And if INSERT is performed and the data is added to the end of the table, then the indices are recalculated first or are they just updated with an "addition to the end of the index"? (index is still INDEX type) - DemoS
    • are added. Similar to a new entry in the telephone directory. - knes
    • Thank you for your help! - DemoS