MySQL - why not index every field?

前端 未结 6 1973
后悔当初
后悔当初 2020-12-02 07:12

Recently I\'ve learned the wonder of indexes, and performance has improved dramatically. However, with all I\'ve learned, I can\'t seem to find the answer to this question.<

6条回答
  •  粉色の甜心
    2020-12-02 08:12

    Keep in mind that every index must be updated any time a row is updated, inserted, or deleted. So the more indexes you have, the slower performance you'll have for write operations.

    Also, every index takes up further disk space and memory space (when called), so it could potentially slow read operations as well (for large tables). Check this out

提交回复
热议问题