Windows Search’s default indexing mode could be writing gigabytes to your SSD every day for a feature almost nobody uses

I have dedicated considerable time to examining Windows 11 and its processes, particularly focusing on the often-overlooked aspects of storage management. Recently, I delved into the contents of my C: drive, anticipating that the search index might be a significant contributor to storage bloat. Contrary to my expectations, I discovered that my search index was a modest 502MB, encompassing nearly 100,000 indexed items. This revelation was surprising, especially given the numerous discussions in online forums where users reported their indices swelling to over 100GB on the same version of Windows 11.

Upon further investigation, I learned that Windows Search retains not only the names of files but also their contents, continuously re-indexing them with each modification. While this may have a negligible impact on some systems, others can experience dramatic increases, with indices reaching up to 200GB.

Windows Indexing could be costing you more storage than you think

It takes one PowerShell script to find out

The file of interest is named Windows.db, which serves as the search index database. This file enables Windows Search to deliver immediate results when you type into the Start menu, rather than re-indexing your drive with every query. Each indexed file has an entry in this database. Unfortunately, Windows does not provide a straightforward method to assess the size of the Windows Indexing, but a simple PowerShell script can reveal this information.

To execute the script, launch PowerShell as an administrator by right-clicking and selecting “Run as administrator.” Then, input the following command:

Get-Item "$env:ProgramDataMicrosoftSearchDataApplicationsWindowsWindows.db" -Force | Select-Object Name, @{n='MB';e={[math]::Round($_.Length/1MB,2)}}

If the output shows a few hundred megabytes, your indexing is functioning properly. My index fluctuates between 449MB and 500MB with nearly 200,000 indexed items, averaging under 2.6KB per file. However, if you encounter a file size exceeding a couple of gigabytes, it warrants further investigation.

What to do when you have an unusually large Windows.db file

There’s a fix, and it’s simpler than you’d think

Should you find your Windows.db file bloated, the simplest remedy is to rebuild the search index—a process made easy by a dedicated button within Windows. However, locating this option can be somewhat challenging. Here’s how to navigate to it:

  1. On your desktop, press Windows + R.
  2. In the Run dialogue box, type control srchadmin.dll.
  3. This will open the Indexing Options window.
  4. Click Advanced at the bottom, and approve the administrator prompt.
  5. On the Index Settings tab, locate the Troubleshooting section and click on Rebuild.
  6. Finally, click OK to confirm.

During the rebuilding process, Windows may notify you that search results could be incomplete. This is acceptable as long as you do not rely on search functionality during this time. I found the entire process took approximately twenty minutes. Once completed, you can rerun the earlier command to check if the size of Windows.db has decreased.

Your indexing mode decides how much of your PC ends up in that database

Classic covers a handful of folders, Enhanced covers a lot more

Windows 11 offers two indexing modes: Classic and Enhanced. Understanding the distinctions between these modes is essential for grasping how they affect the size of your index. The Classic mode, which is the default, indexes your Documents, Pictures, Music folders, and the Desktop. In contrast, Enhanced mode indexes “your entire PC,” as specified in the settings. Both modes allow for exclusions, which can significantly impact index size.

For instance, my index measured 504MB with nearly 100,000 indexed items in Classic mode. Switching to Enhanced mode resulted in over 199,000 indexed items and a size of 604MB within an hour. While this increase may seem minor, on systems with extensive file collections, the growth can be substantial. It’s also worth noting that even in Classic mode, a large Windows.db file may occur if frequently modified files reside in indexed folders, particularly in workflows involving virtual environments.

Classic mode’s indexing is determined by location rather than size. Thus, files like virtual machine images or synced cloud folders in Documents are included, leading to continuous re-indexing whenever changes occur. Community guidelines suggest excluding directories such as virtual machines, node_modules, and large media libraries to mitigate excessive indexing.

On PCs with more than 400,000 search items, performance issues may arise. The indexer can struggle with over a million items, potentially leading to failures or high resource usage.

Managing your storage shouldn’t be this complicated

A database capable of expanding to hundreds of gigabytes should not be hidden in Settings, require admin rights for visibility, and be accessed solely through obscure commands. Fortunately, most of these issues can be addressed with a straightforward diagnosis using PowerShell and a simple index rebuild.

Winsage
Windows Search's default indexing mode could be writing gigabytes to your SSD every day for a feature almost nobody uses