在我用来学习数据库系统的讲义中,我看到了这句话。
索引中涉及的所有列都应该按照它们出现在索引上的相同顺序出现在 WHERE 和 JOIN 子句中。
我在标题 SQL 查询调优下找到了这个。我不明白它在说什么以及为什么。
你能帮我理解这句话吗?
我在谷歌上搜索了一个不太复杂的,但很难知道如何搜索。
在我用来学习数据库系统的讲义中,我看到了这句话。
索引中涉及的所有列都应该按照它们出现在索引上的相同顺序出现在 WHERE 和 JOIN 子句中。
我在标题 SQL 查询调优下找到了这个。我不明白它在说什么以及为什么。
你能帮我理解这句话吗?
我在谷歌上搜索了一个不太复杂的,但很难知道如何搜索。
Not trying to be cute, but I think it means what it says.
When listing items in the join/where clauses, it improves speed to keep everything in the same order. When executing a statement, it is much faster to go top to bottom, then having to search through the statement for the connection/relationship. That is one of the main reasons for using indexes in the first place.
(I can't comment yet - sorry this is in an "answer" section)