Posted on October 5, 2017 · Posted in Windows Server 2008 R2, Windows Server 2012 R2

Windows.edb File Too Big – How to Reduce Size

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\.

Note. This file can be found in all modern client and server Microsoft OSs: from Windows 7/Vista/Server 2008 to Windows 10/Server 2016.

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).

huge Windows.edb file

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

rebuild windows search index

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

Tip. To perform the defragmentation, there should be sufficient free space on the hard drive, since a copy of the EDB file will be created.

Esentutl displays the defragmentation progress on the screen.

Note. If you see the error: Operation terminated with error -1213 (JET_errPageSizeMismatch, The database page size does not match the engine) after 10.125 seconds, after you run esentutl command, it means that you use 64-bit system and to perform defragmentation you need a 64-bit esentutl version. So the third command has to be as follows: "C:\Windows\SysWOW64\esentutl.exe" /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb

defrag Windows-edb with esentutl

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"
del %PROGRAMDATA%\Microsoft\Search\Data\Applications\Windows\Windows.edb
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.

move search index 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.

Related Articles