No indexes on small tables?

后端 未结 13 993
忘掉有多难
忘掉有多难 2020-12-13 06:35

\"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.\" (Donald Knuth). My SQL tables are unlikely to conta

13条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 07:20

    Even if you have an index, SQL Server might not even use it, depending on the statistics for that table. And if you plan to put in an index for a report that will run at most a couple times a year, bear in mind that the INSERT/UPDATE penalties for adding the index will be in effect ALL THE TIME. Before adding an index, ask yourself if it is worth the performance penalty.

提交回复
热议问题