Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / How to Reduce Windows.edb Huge File Size?

December 4, 2020 Windows 10Windows 7Windows Server 2012 R2Windows Server 2016

How to Reduce Windows.edb Huge File Size?

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

huge Windows.edb file

You can check the current size of the Windows.edb file with the following PowerShell command:

((Get-Item $env:programdata'\Microsoft\Search\Data\Applications\Windows\Windows.edb').length/1GB)

powershell get windows.edb file size

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.

Contents:
  • How to Reset and Rebuild Windows Search Index?
  • Reducing Windows.edb Size Using Defragmentation
  • Remove and Recreate the Windows.edb file
  • Move the Windows.edb File to a Different Drive
  • Install the Update Rollup to Fix Windows.edb File Growth
  • Windows.edb File Keeps Growing

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

rebuild windows search index

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

defrag Windows-edb with esentutl

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:
Restart-Service wsearch

move search index file

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.

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;win10 search and index troubleshooter - fix wsearch service
  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); windows 10 set indexing locations
    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.
  3. 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. disable outlook and pst files indexing on windows 10Of 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.

13 comments
2
Facebook Twitter Google + Pinterest
previous post
How to Check or Update Java Version in Windows with PowerShell?
next post
Checking SSL/TLS Certificate Expiration Date with PowerShell

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

13 comments

Kimi January 8, 2019 - 3:24 am

This issue is not only related to Win8 and 2012.

It also happened with Win 10. very terrible.

Reply
William February 7, 2019 - 3:25 pm

This is exactly what I was looking for. Thanks for your help!

Reply
Lou April 7, 2019 - 7:53 am

You saved my life!

Reply
Tony May 8, 2019 - 12:26 am

1st, thank you for this – was running out of space very fast and just caught it in time.

::On Server 2012 R2::
I had a “cant find file” error when i ran this: “esentutl.exe /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb”
My work around was to navigate to the actual directory the .edb file was in:
# cd /d %ProgramData%\Microsoft\Search\Data\Applications\Windows
then run:
# esentutl.exe /d Windows.edb
This worked and our file went from 74GB to 120MB.

Reply
Mikhail September 22, 2019 - 7:32 pm

My file windows.edb was 327 GB. it took all space on C: drive. Thanks a lot for help.

Reply
Meny Assis October 10, 2019 - 1:11 pm

Thank you for your help
life saver

Reply
KB March 6, 2020 - 5:07 pm

377 GB -> 8 MB with the first step.
THANK YOU.

Reply
Jonas August 9, 2020 - 7:00 pm

Thanks, great tip with the defragmentation! Reduced size by 60% in my case, and no need to rebuild the DB.

Reply
Ron February 16, 2021 - 10:57 pm

Thank you so much for the informative article. I’ve been constantly running out of disk space on my laptop’s 250GB drive, when I noticed that my windows.edb file was close to 50GB in size. I did a Delete and Rebuild of my index and the new index shrank down to 340MB, giving me back close to 50GB of disk space.

Reply
Ron February 16, 2021 - 10:59 pm

Oh, and the reindexing took less than a half hour, so it was very fast.

Reply
dekobrist June 16, 2021 - 9:27 am

Article didn’t help – issue still actual on Windows Server 2019 and after index rebuilding it continue to grow.

Reply
Bene007 July 26, 2021 - 1:53 pm

Thank you the Windows.edb was so so Heavy – > Hard Disk almost Full
Solution : Rebuild

Reply
Shakel March 7, 2023 - 7:10 pm

Thanks, that was very helpfull!

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Disable UAC Prompt for Specific Applications in Windows 10?
  • How to Download APPX File from Microsoft Store for Offline Installation?
  • Fix: Windows Cannot Connect to the Shared Printer
  • How to Clean Up Large System Volume Information Folder on Windows?
  • Fixing “Winload.efi is Missing or Contains Errors” in Windows 10
  • Windows Doesn’t Automatically Assign Drive Letters
  • How to Hide Installed Programs in Windows 10 and 11
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top