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?

October 19, 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

Configuring Event Viewer Log Size on Windows

May 24, 2023

How to Detect Who Changed the File/Folder NTFS...

May 24, 2023

Enable Single Sign-On (SSO) Authentication on RDS Windows...

May 23, 2023

Allow Non-admin Users RDP Access to Windows Server

May 22, 2023

How to Create, Change, and Remove Local Users...

May 17, 2023

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

  • Configuring Event Viewer Log Size on Windows

    May 24, 2023
  • How to Detect Who Changed the File/Folder NTFS Permissions on Windows?

    May 24, 2023
  • Enable Single Sign-On (SSO) Authentication on RDS Windows Server

    May 23, 2023
  • Allow Non-admin Users RDP Access to Windows Server

    May 22, 2023
  • How to Create, Change, and Remove Local Users or Groups with PowerShell?

    May 17, 2023
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows

    May 16, 2023
  • View Success and Failed Local Logon Attempts on Windows

    May 2, 2023
  • Fix: “Something Went Wrong” Error When Installing Teams

    May 2, 2023
  • Querying Windows Event Logs with PowerShell

    May 2, 2023
  • Configure Windows LAPS (Local Administrator Passwords Solution) in AD

    April 25, 2023

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Allow Multiple RDP Sessions in Windows 10 and 11?
  • Error Code: 0x80070035 “The Network Path was not found” after Windows 10 Update
  • 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
  • Installing RSAT Administration Tools on Windows 10 and 11
  • How to Clean Up Large System Volume Information Folder on Windows?
Footer Logo

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


Back To Top