Windows Search ate up too much space on my SSD

Configurare noua (How To)

Situatie

Solutie

First, I checked how large Windows.db had become

Windows Terminal gave me the number without changing folder permissions

A screenshot of PowerShell open with with the results of a command showing the size of the Windows.db file.

A screenshot of Windows Search open. The right-click context menu for Terminal is open and Run as Administrator is highlighted in red.

A screenshot of PowerShell open with a prompt that check the size and location of Windows.db.

Windows doesn’t show the size of its search database anywhere in Settings, and the folder that contains Windows.db is protected. Rather than changing ownership of a system folder, I opened Windows Search, typed Terminal, right-clicked Terminal, selected Run as administrator, and clicked Yes when Windows asked for permission.

I then pasted the following command into the Terminal window and pressed Enter:

Get-Item "C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.db" -Force |
Select-Object Name,@{Name="Size (MB)";Expression={[math]::Round($_.Length / 1MB,1)}}

The command only reads the reported size of Windows.db. It doesn’t modify the file or change any permissions. The first time I checked Windows.db, it measured about 1.3 GB, which was larger than I expected for a search feature I rarely use. After moving from Enhanced to Classic search, it dropped to 729 MB.

With a starting point established, I could move on to reducing what Windows can index.

I reduced what Windows was allowed to index

Classic search covered what I needed without indexing everything

A screenshot of Windows 11 Settings open to the Privacy & security tab.

A screenshot of Windows 11 Settings open to the Privacy & security Search tab.

A screenshot of Windows 11 Settings open to the Privacy & security Search tab. The Indexing Options menu is open.

A screenshot of Windows 11 Settings open to the Privacy & security Search tab. The Indexing Options menu is open.

A screenshot of Windows 11 Settings open to the Privacy & security Search tab. The Advanced Options menu is open.

I opened Settings > Privacy & security > Search, then looked under Find my files. From there, I switched from Enhanced to Classic, selected Customize search locations, clicked Modify, and reviewed the folders Windows was including in the index. I left the Start menu and the locations I still wanted searchable, but removed OneDrive, backup folders, and other places I rarely use through Windows’ built-in search.

The difference between the two modes is fairly simple. Enhanced search indexes the entire PC, while Classic focuses on common locations such as the Start menu and user folders. Enhanced can be useful if you keep files scattered across several drives and rely heavily on Windows Search, but it was unnecessary for the way I use my computer. OneDrive was an easy exclusion because I don’t use it, and I had no reason to make my backups searchable. Downloads, video folders, game libraries, virtual machines, old project folders, and large archives are also worth reviewing because they can contain thousands of files that add to the index without making search meaningfully more useful.

Removing a folder from the index doesn’t delete anything or make it inaccessible. Files in that location may no longer appear in searches from the Start menu, while searches performed directly inside the folder through File Explorer may take longer. That tradeoff made sense for my backups and OneDrive folders, but readers who rely heavily on Windows Search may want to keep more locations included.

I rebuilt the Windows Search index

Windows created a new database using the smaller set of locations

A screenshot of Windows 11 Settings open to the Privacy & security Search tab. The Indexing Options Advanced Options menu is open and the Rebuild button is in the troubleshooting section.

After I finished reducing the folders Windows was allowed to index, I opened Indexing Options, clicked Advanced, and approved the administrator prompt. On the Index Settings tab, I scrolled down to the Troubleshooting section, clicked Rebuild, and then clicked OK to confirm. Windows warned me that search results might be incomplete while it worked, but I could keep using the PC during the rebuild.

Once Indexing Options reported that indexing was complete, I ran the same Terminal command again. The reported size of Windows.db had dropped from the starting size of 1.3 GB to 687 MB, a reduction of roughly 613 MB without disabling Windows’ built-in search.

A PowerShell Window open up showing with the results from a command that shows the size of Windows.db.

Rebuilding the index fixed the immediate problem, but the more important change was reducing what Windows was allowed to search. By enabling Classic search and excluding OneDrive, backups, and other folders I don’t use, Windows now has far fewer files to track.

Tip solutie

Permanent

Voteaza

(3 din 5 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?