Using more than one index per table is dangerous?

后端 未结 9 1982
春和景丽
春和景丽 2021-02-02 14:25

In a former company I worked at, the rule of thumb was that a table should have no more than one index (allowing the odd exception, and certain parent-tables holding references

9条回答
  •  后悔当初
    2021-02-02 15:12

    You should of course be careful not to create too many indexes per table, but only ever using a single index per table is not a useful level.

    How many indexes to use depends on how the table is used. A table that is updated often would generally have less indexes than one that is read much more often than it's updated.

    We have some tables that are updated regularly by a job every two minutes, but they are read often by queries that vary a lot, so they have several indexes. One table for example have 24 indexes.

提交回复
热议问题