Index all columns

前端 未结 6 2115
梦毁少年i
梦毁少年i 2021-02-18 14:58

Knowing that an indexed column leads to a better performance, is it worthy to indexes all columns in all tables of the database? What are the advantages/disadvantages of such ap

6条回答
  •  余生分开走
    2021-02-18 15:31

    • Every index requires additional CPU time and disk I/O overhead during inserts and deletions.
    • Indies on non-primary keys might have to be hanged on updates, although an index on the primary key might not (this is beause updates typially do not modify the primary-key attributes).
    • Each extra index requires additional storage spae.
    • For queries whih involve onditions on several searh keys, e ieny might not be bad even if only some of the keys have indies on them. Therefore, database performane is improved less by adding indies when many indies already exist.

提交回复
热议问题