The Windows.edb file is the database that powers Windows Search indexing. On many Windows 11 systems, this file can grow past 5 GB and sometimes exceed 10 GB. The primary cause is the sheer volume of indexed content, especially emails, file metadata, and system files. This article explains why the database expands so much and shows you how to limit its size using built-in tools.
Windows.edb is stored in the hidden folder C:\ProgramData\Microsoft\Search\Data\Applications\Windows. When you search for a file, email, or setting, Windows Search queries this database. Over time, the database accumulates entries from every indexed location. If you have large mailboxes, network drives, or many files, the database grows proportionally.
You can cap the Windows.edb file size by adjusting the indexing scope, rebuilding the database, or using a registry tweak to set a hard limit. This article covers all three methods. You do not need third-party software. All steps use tools built into Windows 11.
Key Takeaways: Controlling Windows.edb Growth on Windows 11
- Settings > Privacy & security > Searching Windows > Indexing Options > Modify: Removes folders from the index to reduce the database size immediately.
- Indexing Options > Advanced > Rebuild: Deletes and recreates the Windows.edb file, clearing accumulated bloat and orphaned entries.
- Registry Editor > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Gathering Manager\MaxFileSizeMB: Sets a hard cap on the Windows.edb file size in megabytes.
Why Windows.edb Grows Past 5 GB
Windows Search indexes file names, file contents, metadata, and properties. Each indexed item creates one or more entries in the Windows.edb database. The database uses the Extensible Storage Engine, which stores data in B-tree structures. These structures can become fragmented over time, increasing the database size beyond the actual data stored.
The most common contributors to a large Windows.edb file are:
- Outlook PST or OST files — each email, attachment, and calendar item adds an entry
- Network shares and mapped drives — files on remote locations are indexed locally
- Large document libraries — PDFs, Office files, and images with embedded text
- Orphaned entries — files that were deleted but their index records remain after a failed cleanup
The default index includes the entire C\Users folder, Start Menu, and offline files. If you have more than 100,000 files in your user profile, the database can easily exceed 5 GB. The system does not automatically cap the file size. You must manually configure limits or reduce the indexed content.
Steps to Reduce and Cap Windows.edb Size
Before making any changes, check the current Windows.edb file size. Open File Explorer, navigate to C:\ProgramData\Microsoft\Search\Data\Applications\Windows, and right-click Windows.edb. Select Properties and note the Size on disk value. This gives you a baseline to compare after you apply the fixes.
Method 1: Remove Unnecessary Indexed Locations
- Open Indexing Options
Press the Windows key, type “Indexing Options,” and select the result. The Control Panel applet opens. - Click Modify
In the Indexing Options window, click the Modify button at the bottom. A new window titled Indexed Locations appears. - Uncheck Folders You Do Not Need Indexed
Expand the tree under each drive. Uncheck folders such as Downloads, Temp, or any folder that contains temporary files. Also uncheck network drives if you do not need to search them often. - Click OK and Wait
Windows Search immediately removes those folders from the index. The Windows.edb file size will decrease over the next few minutes as the indexer cleans up orphaned entries.
Method 2: Rebuild the Windows.edb Database
- Open Indexing Options
Same as Method 1 — press the Windows key, type “Indexing Options,” and open it. - Click Advanced
In the Indexing Options window, click the Advanced button. A new window titled Advanced Options opens. - Click Rebuild under Troubleshooting
In the Advanced Options window, locate the Troubleshooting section and click the Rebuild button. A confirmation dialog warns that the index will be rebuilt from scratch. Click OK. - Wait for Completion
The rebuild process deletes the existing Windows.edb file and creates a new one. This can take several hours depending on the number of files. You can continue using your PC, but search results will be incomplete until the rebuild finishes. Check the Indexing Options window for the status message.
Method 3: Set a Registry-Based Size Cap
- Open Registry Editor
Press Windows + R, type regedit, and press Enter. Click Yes in the User Account Control prompt. - Navigate to the Windows Search Key
Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Gathering Manager. If the Gathering Manager key does not exist, right-click Windows Search, select New > Key, and name it Gathering Manager. - Create MaxFileSizeMB Value
Right-click in the right pane, select New > DWORD (32-bit) Value. Name it MaxFileSizeMB. Double-click the new value, select Decimal, and enter the maximum size in megabytes. For a 5 GB cap, enter 5000. For a 3 GB cap, enter 3000. - Restart Windows Search Service
Press Windows + R, type services.msc, and press Enter. Locate Windows Search in the list. Right-click it and select Restart. The service restarts and the Windows.edb file will not grow beyond the cap you set.
Common Issues and Limitations After Capping Windows.edb
Search Results Are Missing After Rebuilding the Index
After a rebuild, Windows Search may not find files that were previously indexed. This is expected because the indexer must re-scan all included folders. The process can take several hours. To speed it up, ensure your PC is plugged in and not in power-saving mode. You can also open Indexing Options and verify that indexing is not paused.
Registry Cap Does Not Take Effect
If you set MaxFileSizeMB but the Windows.edb file continues to grow, check that the value is a DWORD (32-bit) and that the base is set to Decimal. Also confirm that the Windows Search service was restarted. If the cap still does not work, the database may have already exceeded the cap before you applied the setting. Rebuild the index using Method 2, then restart the service again.
Windows.edb File Is Not Shrinking After Removing Folders
Removing indexed locations tells the indexer to delete entries for those folders. However, the database file does not always shrink immediately. The Extensible Storage Engine reserves space for future entries. To reclaim the disk space, you must rebuild the database using Method 2. After the rebuild, the Windows.edb file will be significantly smaller.
Manual Cap vs Rebuild vs Folder Removal: Which Method Works Best
| Item | Remove Indexed Locations | Rebuild Database | Registry Cap |
|---|---|---|---|
| Effect on Windows.edb | Reduces size over time | Deletes and recreates the file | Prevents growth beyond the limit |
| Time to complete | Minutes to hours | Hours to a day | Minutes |
| Search availability | Available during removal | Unavailable until rebuild finishes | Available immediately |
| Requires reboot | No | No | Service restart only |
| Best for | Reducing future growth | Shrinking a bloated database now | Enforcing a hard size limit |
You can combine all three methods. Remove unnecessary indexed locations first, then rebuild the database to shrink it, and finally apply the registry cap to prevent future growth. This combination gives you the most control over the Windows.edb file size.
Now you can manage the Windows.edb file size on your Windows 11 system. Start by checking the current size in C:\ProgramData\Microsoft\Search\Data\Applications\Windows. If the file is above 5 GB, use the Rebuild option in Indexing Options to reset it. Then apply the MaxFileSizeMB registry value to keep it under control. As an advanced tip, you can also exclude file types from indexing by adding their extensions to the Exclude list in Indexing Options > Advanced > File Types. This prevents large media or archive files from adding entries to the database.