Windows.edb is the Windows Search index database. A search index allows users to quickly search for data and files in the file system due to indexing of files, e-mails in PST files and other content. Indexing is performed in the background by the
SearchIndexer.exe process. Obviously, the more files there are in the system, the larger the size of the Windows.edb file. In some cases, it can grow up to tens or even hundreds of GB, taking up all the free space on the system drive.
The Windows.edb file is hidden and by default is stored in the folder C:\ProgramData\Microsoft\Search\Data\Applications\Windows\.Note. The Windows.edb file can be found in all modern client and server Microsoft OSs: from Windows 7/Server 2008 to Windows 10/Server 2019.
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).
You can check the current size of the Windows.edb file with the following PowerShell command:
You can find all large files on your computer with a simple PowerShell script .
Next, let’s look at a several ways to reduce the size of the huge Windows Search Index (Windows.edb) file.
How to Reset and Rebuild 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 -> click Rebuild (to open this dialog box, you can run the following command: Control srchadmin.dll ).
In some time, the Windows Search will complete a full reindex of the data on the system drive (and other indexed location), and the size of the edb file will be reduced (it took several hours to rebuild the search index on my computer).
Reducing Windows.edb Size Using Defragmentation
The Windows Search Index file is a Microsoft EDB database. You can defragment the EDB database using the standard tool for maintaining such databases, esentutl.exe (Extensible Storage Engine Utility – should be familiar to Exchange admins). The database is defragmented offline (it must not be used), so you will have to stop Widows Search service first. You can join all these operations in a single bat/cmd script:
sc config wsearch start=disabled
sc stop wsearch
esentutl.exe /d %ProgramData%\Microsoft\Search\Data\Applications\Windows\Windows.edb
sc config wsearch start=delayed-auto
sc start wsearch
Tip. To perform the defragmentation, there should be sufficient free space on the hard drive, since a full copy of the EDB file will be created.
Esentutl displays on the screen the current EDB file defragmentation progress.
Note. If you see an error after running the esentutl command:
Operation terminated with error -1213 (JET_errPageSizeMismatch, The database page size does not match the engine) after 10.125 seconds.
This means that you are using a 64-bit OS and you need to use the x86 esentutl version to perform defragmentation. In this case, the third command will look like this:
"C:\Windows\SysWOW64\esentutl.exe" /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb
In my case, after the defragmentation, the size of the Windows.edb file reduced by 30%.
Remove and Recreate the Windows.edb file
If free disk space is critical, you can safely delete the Windows.edb file. This action is safe because you don’t lose any data, only the search index is reset. To delete the Windows.edb file, stop the Windows Search service, then delete the file and start the service. net stop "Windows Search" REG ADD "HKLM\SOFTWARE\Microsoft\Windows Search" /v SetupCompletedSuccessfully /t REG_DWORD /d 0 /f del %PROGRAMDATA%\Microsoft\Search\Data\Applications\Windows\Windows.edb net start "Windows Search"
The value of the registry parameter SetupCompletedSuccessfully = 0 in the reg key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search forces the Windows Search service to reset the current settings and indexing paths at the next start, restore the default wsearch parameters and add the default indexing paths.
After you restart Windows Search, it will start the background reindexing process and recreate the Windows.edb file (system performance may decrease during the full reindexing).
Move the Windows.edb File to a Different 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 drive (volume). Thus, a sharp increase in the search database won’t cause an OS crash due to the exhaustion of free space on the system partition. 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 index file location, go to Control Panel -> Indexing Options -> Advanced -> Index location-> New Location, specify the path to the new location of Windows.edb file and click Ok.
Restart Windows Search service:
Install the Update Rollup to Fix Windows.edb File Growth
A special update was released in May, 2013 to fix the problem of the constant growth of Windows.edb file in Windows 8 and Windows Server 2012 (this bug fix is a part of update rollup KB 2836988). It is recommended to manually download and install this patch on these Windows versions. Please note that the update doesn’t reduce the current size of the Windows.edb file, but only fixes the bug causing it to grow excessively. To reduce the size of the edb file, you need to rebuild the search index or defragment as described above.
For other versions of Windows, it is always recommended to install the latest cumulative updates through Windows Update or WSUS.
What to do if Windows.edb File Keeps Growing
If the Windows.edb file starts growing again after defragmenting and/or rebuilding the search index, try the following methods that may help you to fix the issue:
1. Run the built-in Windows 10 Search and Indexing Troubleshooter. You can run this using the command: msdt.exe -ep SystemSettings_Troubleshoot_L2 -id SearchDiagnostic . In the list of issues, select “Search or indexing is slow”. The troubleshooting wizard will then try to get the Windows Search service back to normal state:
2. Try to index only the content you need. Exclude items you are not looking for from the search index. Click the “Modify” button in the indexing settings and in the “Indexing Location” window, disable paths and apps that you don’t want to be indexed. After changing the index path settings, you need to rebuild the search index each time (Advanced -> Rebuild):
Also note that Windows.edb file size grows much faster in Windows 10/8.1 than in Windows 7. The fact is that in modern Windows versions, all file contents are indexed, regardless of their size. And Windows 7 indexed only the first part of large documents.
- If you use Outlook with PST files on your computer, then when you index them, the size of the Windows.edb file grows in proportion to the size of the PST files. This can lead to running out of disk space and performance problems. This can lead to insufficient disk space and slow computer performance. In this case, Microsoft recommends excluding Outlook from the list of indexed items. Of course, Outlook search will stop working (this won’t be a problem if you store your mailbox on an Exchange server with search index enabled);
4. If nothing helps and the Windows.edb file size keeps growing, you can completely disable the wsearch service or configure a logon script that resets the search index on startup.