>列。Consider your phone book: it's order probably by LastName, FirstName, maybe Street. So does that indexing help you find all "Joe's" in your city? All people living on "Main Street" ?? No - you can lookup by LastName first - then you get more specific inside that set of data. Just having an index over everything doesn't help speed up searching for all columns at all.如果您希望能够搜索到街道 - 你需要在(街道)上添加一个单独的索引(可能还有另外一两列有意义) 。If you want to be able to search by Street - you need to add a separate index on (Street) (and possibly another column or two that make sense).如果你想通过占领或其他任何东西进行搜索 - 你需要另一个特定的指数。If you want to be able to search by Occupation or whatever else - you need another specific index for that.仅仅因为您的列存在于索引中并不意味着会加快该列的所有搜索速度!Just because your column exists in an index doesn't mean that'll speed up all searches for that column!主要规则是:使用尽可能少的索引 - 对于系统来说,太多的索引可能比没有索引更糟糕了......构建系统,监视其性能,并找到那些成本的查询最多 - 然后优化这些,例如通过添加索引。The main rule is: use as few indices as possible - too many indices can be even worse for a system than having no indices at all.... build your system, monitor its performance, and find those queries that cost the most - then optimize these, e.g. by adding indices.不要只是盲目地索引每一列只是因为你可以 - 这是糟糕的系统性能的保证 - 任何索引也需要维护和维护,所以索引越多你你的INSERT,UPDATE和DELETE操作会越多(变得越来越慢),因为所有这些索引都需要更新。Don't just blindly index every column just because you can - this is a guarantee for lousy system performance - any index also requires maintenance and upkeep, so the more indices you have, the more your INSERT, UPDATE and DELETE operations will suffer (get slower) since all those indices need to be updated. 这篇关于SQL索引和性能改进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!