Using different methods such as defragmenting, removing, and re-creating, moving the windows.edb file into another drive, the Windows.edb size can be reduced.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform Windows related queries.
In this context, we shall look into the steps to reduce windows.edb size.
More information about windows.edb file?
The Windows.edb is a database file of the Windows Search index. It mainly provides content indexing, property caching, and search results for files, e-mail, and other content.
All the indexing process is done in the background by the SearchIndexer.exe process. So the size of the Windows.edb file increases when there are more files in the system.
By default, the Windows.edb file is located in the following path;
Here is the PowerShell command to check the current size of the Windows.edb file;
How to reduce Windows.edb huge File Size?
Here are the steps to reduce the file size of Windows.edb file.
1. How to Reset and Rebuild the Windows Search Index
This is one of the most appropriate, though not too effective ways to reduce the size of Windows.edb. This involves re-indexing the files in the system.
In order to do it, first, open "Control Panel >> Indexing Options >> Advanced >> click Rebuild "(to open this dialog box, run the following command: Control srchadmin.dll ).
Within a few minutes, the Windows Search will complete a full reindex of the data on the system drive. This will reduce the size of the edb file.
2. Reduce Windows.edb size using Defragmentation
The EDB database can be defragmented using the standard tool for maintaining such databases, esentutl.exe. You need to defragment the database offline. so first, stop the Windows Search service. Then run the following 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
Make a note that you have enough space in the hard drive, as a copy of the EDB file is created in it.
3. Remove and Recreate the Windows.edb file
You can safely delete the Windows.edb file if the free disk space is critical. It is safe because you don’t lose any data, instead only the search index is reset.
In order 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
net start "Windows Search"
Once you restart the Windows Search, it will start the background reindexing process and recreate the Windows.edb file.
4. Moving the Windows.edb file into a Different Drive
If the Windows.edb file size is growing constantly, then it is better to move the index database of Windows Search to another drive. So if there is an increase in the search database, it won't cause the OS to crash.
To do this;
i. So to change the index file location, go to "Control Panel >> Indexing Options >> Advanced >> Index location >> New Location".
ii. Then, specify the path to the new location of Windows.edb file, and click Ok.
iii. Now restart the Windows Search service.
iv. Restart-Service search
Windows.edb file size Keeps Growing
If the Windows.edb file continues to grow even after following the above methods, then try the steps.
i. Try to run the built-in Windows 10 Search and Indexing Troubleshooter. For that, run the below command.
msdt.exe -ep SystemSettings_Troubleshoot_L2 -id SearchDiagnostic
ii. 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 the normal state;
iii. Index only the content you need. Make sure to exclude items you are not looking for from the search index.
iv. First, 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. v. Rebuild the search index each time (Advanced -> Rebuild) after changing the index path settings.
vi. If you are using 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 and also slow computer performance. In such a case, Microsoft recommends excluding Outlook from the list of indexed items.
If nothing helps and the Windows.edb file size keeps on growing then you can completely disable the wsearch service. Or you can also configure a login script that resets the search index on startup.