What are the disadvantages of having many indices?

后端 未结 4 796
礼貌的吻别
礼貌的吻别 2021-01-01 16:43

I recently sped up a complicated query by an order of magnitude by giving SQLite a good index to work with. Results like this make me wonder if I should index a lot of other

4条回答
  •  悲哀的现实
    2021-01-01 17:22

    The cost of an index in disk space is generally trivial. The cost of additional writes to update the index when the table changes is often moderate. The cost in additional locking can be severe.

    It depends on the read vs write ratio on the table, and on how often the index is actually used to speed up a query.

提交回复
热议问题