数据库
数据库文档
dabusidede
Github:https://github.com/IceEmblem,
Word文档文章:https://github.com/IceEmblem/LearningDocuments
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数据库 分页查询优化
word文档地址:https://github.com/IceEmblem/-/tree/master/%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%96%99/Windows%20%E5%B9%B3%E5%8F%B0/%E6%95%B0%E6%8D%AE%E5%BA%93 一般的分页sql select top 10 * from Admin where AdminID not in (select top 1500000 AdminID from Admin) 使用not in会引发原创 2020-12-11 19:16:21 · 316 阅读 · 0 评论 -
数据库 查询优化
避免全表扫描 当我们的where过滤的字段没有索引时,就会发生全表扫描,如下,当我们的Name字段没有索引时,就会发生全部扫描 select * from dbo.Pages where Name = 'Home' 当字段拥有索引时,我们对字段使用函数或表达式也会发生全表扫描 -- 这里会发生全表扫描 select * from dbo.Pages where SUBSTRING(Name, 1, 2) = 'Ho' -- 改进:使用like select * from dbo.Pages whe原创 2020-12-04 19:54:22 · 351 阅读 · 0 评论
分享