Windows.edb is an index database of Windows Search service, which provides faster search of data in the file system due to indexing of files, e-mails in PST files and other content. Obviously, the more files there are in the system, the larger is Windows.edb. In some cases, it can grow to tens or even hundreds of GB, taking up all the free space on the system disk.
This file is hidden and by default stored in the folder C:\ProgramData\Microsoft\Search\Data\Applications\Windows\.
For example, in my case the size of Windows.edb is more than 15.5 GB (i. e. over 15% on my 100 GB SSD drive).
There are several ways to manage Windows.edb growth
Rebuilding Windows Search Index
The most appropriate, though not too effective, way to reduce the size of Windows.edb is to re-index the files in the system. To do it, open Control Panel -> Indexing Options -> Advanced -> Rebuild (to open this dialog box, you can run the following command:
rundll32.exe shell32.dll,Control_RunDLL srchadmin.dll
In some time (as a rule, it takes quite a long time), the system will finish data re-indexing, and the size of the EDB file will be reduced.
Windows.edb Defragmentation Using Esentutl
Since the index file of Windows Search service is a database in the EDB format, you can run its defragmentation using a standard utility for this type of databases, esentutl.exe — Extensible Storage Engine Utilities (Exchange administrators should be familiar with it).The database is defragmented offline (it must not be used), so you will have to stop Widows Search first. You can join all these operations in a single script:
sc config wsearch start=disabled
sc stop wsearch
esentutl.exe /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb
sc config wsearch start=delayed-auto
sc start wsearch
Esentutl displays the defragmentation progress on the screen.
"C:\Windows\SysWOW64\esentutl.exe" /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb
In my case, after the defragmentation the size of the EDB file reduced by 30%.
Delete and Recreate the Windows.edb file
If there is too little free space on your disk, you can safely delete Windows.edb. To do it, stop Windows Search and delete the file.
net stop "Windows Search"
net start "Windows Search"
After you restart Windows Search, it will start system re-indexation and recreate the Windows.edb file (in the process of full reindexing, system performance may decrease).
Move Windows.edb File to Another Drive
In some cases, when the size of Windows.edb file is constantly growing, it is better to move the index database of Windows Search to another volume. Thus, the extreme growth of the database won’t result in stopping the system when the system space is exhausted. As a rule, you should do it on RDS servers, where users actively work with files, personal folders and other indexed content.
To change the file location, open Control Panel\Indexing Options\Advanced\ Index location->New Location and specify the path to the new location of Windows.edb file.
Fix to Prevent Excessive Windows.edb Growth in Windows 8 / Windows Server 2012
To solve the problem of the constant growth of Windows.edb file in Windows 8 and Windows Server 2012, a special fix was issued that was included in the update package of May, 2013 – KB 2836988. It is recommended to download and install it for these Windows versions.