Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我面临一个问题,即使我在IsGrantor和上创建了索引,查询计划中也会显示键查找IsGrantee。请参阅随附的屏幕截图和输出列表。
IsGrantor
IsGrantee
该表大约包含大约 50 万条记录。
任何帮助,将不胜感激。
如果您的索引不是覆盖索引,则会发生键查找。不覆盖意味着它不能提供查询所需的所有列。这样就完成了对集群索引的剩余列键查找。
You can try following Drop unnecessary columns from select list Include columns in your non cluster index to make it covering.
此外,如果您减少结果集中的行数,那么一些键查找也不会造成太大影响。