<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[gOxiA=苏繁=SuFan Blog]]></title> 
<link>https://maytide.net/index.php</link> 
<description><![CDATA[gOxiA,苏繁,sufan,Microsoft MVP]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[gOxiA=苏繁=SuFan Blog]]></copyright>
<item>
<link>https://maytide.net/read.php/2079.htm</link>
<title><![CDATA[HOWTO: 解决Windows搜索索引性能和容量问题]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[Windows Client]]></category>
<pubDate>Sun, 16 Jul 2023 06:27:03 +0000</pubDate> 
<guid>https://maytide.net/read.php/2079.htm</guid> 
<description>
<![CDATA[ 
	<p><img alt="troubleshooting" src="http://goxia.maytide.net/ftpup/2016/a2734efd2a17_D06F/troubleshooting_thumb.png"></p><p><font color="#fd3f0d" size="4"><strong>HOWTO: 解决Windows搜索索引性能和容量问题</strong></font></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当 Windows 搜索性能较差或发现磁盘空间正被索引数据库吞噬时就需要进行相关的优化。通常索引性能受其项目数量和总体大小因素影响。当索引超过40万个项目时，我们便可能觉察到性能问题，它将直接体现在CPU、内存或磁盘利用率上。此外，Windows 搜索还会为 Outlook 邮箱生成索引，如果邮箱包含了超过6万个项目时，索引的性能也可能会降低。</p><p><a href="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-1.png"><img width="634" height="270" title="searchindex-1" style="display: inline; background-image: none;" alt="searchindex-1" src="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-1_thumb.png" border="0"></a></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在容量方面，随着索引数量的增长，不管这些项目的大小如何，索引数据库都会大幅增长。当然项目本身的大小也会影响数据库的大小。索引数据库的文件名为“Windows.edb”，该文件位于<strong>“%programdata%\Microsoft\Search\Data\Applications\Windows</strong>”下，若要检查该数据库的容量不能仅从文件大小来看，而是要进入其文件属性查看“占用空间”来检查其实际占用的磁盘空间。</p><p><a href="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-2.png"><img width="634" height="424" title="searchindex-2" style="display: inline; background-image: none;" alt="searchindex-2" src="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-2_thumb.png" border="0"></a></p><p><a href="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-3.png"><img width="547" height="775" title="searchindex-3" style="display: inline; background-image: none;" alt="searchindex-3" src="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-3_thumb.png" border="0"></a></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如我们所见，当索引数量和容量这两个因素加在一起时，会使索引问题复杂化。优化的方式有一些，下来我们来看看如何对 Windows 索引进行调优。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 首先，最简单直（Cu）接（Bao）的方法是重建索引。相当于复位了索引数据库，能解决不少问题，但带来的不利因素是重建时所消耗的时间和资源，并且随着时间的推荐，我们的索引依旧会重现数量和容量问题。</p><p><a href="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-4.png"><img width="634" height="563" title="searchindex-4" style="display: inline; background-image: none;" alt="searchindex-4" src="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-4_thumb.png" border="0"></a></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第二种方法，为搜索索引排除文件夹，可以打开 Windows 11 的设置应用，定位至“隐私和安全性”，使用“添加要排除的文件夹”按钮来添加。对于 Windows 10 系统可以在设置的搜索框中键入“搜索”或“排除”查找。</p><p><a href="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-5.png"><img width="634" height="539" title="searchindex-5" style="display: inline; background-image: none;" alt="searchindex-5" src="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-5_thumb.png" border="0"></a></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第三种方法，更改索引处理特定文件类型的方式。我们可以打开“索引选项”，在“高级选项”下的“文件类型”选项卡内进行配置。</p><p><a href="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-6.png"><img width="634" height="548" title="searchindex-6" style="display: inline; background-image: none;" alt="searchindex-6" src="http://goxia.maytide.net/ftpup/2018/3a04d1b804ab_B8D2/searchindex-6_thumb.png" border="0"></a></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第四种方法，在讲之前我们先了解一个特性！自 Windows 8 开始至 Windows 10/11 索引数据库合并了文件属性和持久索引两类数据，并且会索引整个文件，这种设计是为了提高搜索的召回率和索引以及查询的性能，即全面/综合索引法，这种方法虽然提高了搜索和查询的效率和准确性，但问题也很显而易见，尤其是在小容量固态硬盘普及时期，或小容量系统卷时，大家总会发现硬盘可用容量在不断被吞噬。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 而在 Windows 7 时代，索引数据库只包含了文件属性，而持久索引则单独存储在一个扩展名为 .ci 的文件中，并且对于大型文件也只会对前部分进行索引，所以 Windows 7 的索引数据库要小很多，但其缺点也显而易见。由于文件属性和持久性索引数据存储在不同的文件中，因此可能会导致索引数据的不一致性和丢失（这就是为什么 Windows 7 时代搜索故障/问题在 IT HelpDesk 居高不下的原因）；对于大型文件，由于只索引了文件的前部分，这极大增加了搜索结果的不完整和不准确性；如果需要进行全文搜索的文件类型（TXT），其索引速度会慢很多，因为它需要访问 .ci 文件中的持久性索引数据。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 全面/综合索引和分离式索引的数据存储方式各自都有一些弊端，但考虑到实际效率，且计算性能的提升以及固态存储成本的降低，前者更适应我们现实需求。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 另外，还有一个问题不容忽视，Outlook 的邮箱数据文件！通常我们仅会缓存一年或者半年的邮件，此时并不会遇到很严重的容量问题。但是如果客户端将 Outlook 配置为使用 PST 文件，并且下载了所有数据，那么在 Windows 10/11 平台上，由于前面所描述的特性因素，会发现 Windows.edb 的文件容量非常之大。此时 IT 人员就需要考虑为客户端减少索引范围，然后重新生成索引来缓解。或者使用第四种方法 - 对索引数据库进行碎片整理，为此执行如下命令行。</p><p><strong>sc config wsearch start=disabled</strong></p><p><strong>net stop wsearch</strong></p><p><strong>esentutl.exe /d %programdata%\Microsoft\Search\Data\Applications\windows.edb</strong></p><p><strong>sc config wsearch start=delayed-auto</strong></p><p><strong>net start wsearch</strong></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OK，今天的分享就到这里！如果您在应用和部署 Windows 时遇到什么问题欢迎与我联系交流。</p>
]]>
</description>
</item>
</channel>
</rss>