Glossary/Processes you will see

mds_stores and mdworker

Also: mds, Spotlight indexing

Quick answer

mds, mds_stores and mdworker are the macOS processes that build and maintain the Spotlight search index. mds is the metadata server, and mdworker processes scan files and read their contents and metadata so they can be found in search.

Spotlight keeps a local index of your files, apps, mail and other data so searches return quickly. When files are added or changed, or a disk is connected, mdworker reads them and mds and mds_stores update the index.

Heavy indexing is normal after a macOS update, after migrating to a new Mac, after restoring from a backup, or when you copy in a large number of files. It should settle once the index is up to date.

Why mds_stores is using so much CPU

Indexing takes CPU and disk activity in proportion to how much needs indexing. A fresh index of a full disk can take a while. Folders that change constantly, such as build output, large caches or virtual machine images, can keep Spotlight busy for as long as they keep changing.

Several mdworker processes at once is normal. Spotlight runs more than one to scan files in parallel.

How to stop Spotlight indexing a folder

Open System Settings, go to Spotlight (Siri & Spotlight on some versions), click Search Privacy, and add the disk or folder. Spotlight stops indexing it and stops showing it in search results.

Good candidates are folders you never search and that change often, like build directories, package caches, or a folder of virtual machines.

When to rebuild the index

If indexing never seems to finish or search results are wrong, Apple suggests rebuilding the index: add the disk or folder to the Search Privacy list, wait a few seconds, then remove it. Spotlight reindexes that location, which will keep mds_stores busy for a while.

How to check if Spotlight is indexing

Activity Monitor shows the processes, and Terminal can tell you whether indexing is turned on for a disk.

  1. In Activity Monitor, click the CPU tab and type md in the search field. You will see mds, mds_stores, and one or more mdworker or mdworker_shared processes.
  2. Watch their % CPU for a minute. Low or zero means Spotlight is idle. Steady activity means it is still working through files.
  3. Click the Disk tab and look at the Bytes Read column for the same processes. Indexing reads a lot, so a count that keeps growing means scanning is still going on.
  4. In Terminal, run mdutil -s / to see the indexing status of the startup disk. It prints Indexing enabled. when Spotlight is set to index that disk. For another disk, replace / with its path, such as /Volumes/Backup.

How long does Spotlight indexing take?

It depends on how many files need indexing, how fast the disk is, and how busy the Mac is with other work. A full index of a large disk takes much longer than catching up on a few changed files, and the same Mac can finish quickly one day and take hours after a big copy or a macOS update.

The better question is whether it is making progress. If mds_stores and mdworker get quieter over a few hours, it is finishing. If they stay busy day after day, something keeps changing files, or the index needs a rebuild.

Common reasons indexing never finishes

If Spotlight stays busy long after an update or a migration, look for a location that keeps changing.

  • Build output, node_modules, or package caches that are rewritten often.
  • Virtual machine disk images or large databases that change while in use.
  • A folder that another app writes to constantly, such as a download or sync folder.
  • An external drive that is connected and disconnected often, which Spotlight checks each time it mounts.
  • A damaged index, which is when rebuilding it from Search Privacy helps.

What not to do

Do not turn Spotlight off for your whole startup disk to save CPU. Other features depend on the index, including searching in Finder, Mail and other apps. Exclude only the folders you do not need to search.

Quitting mdworker or mds_stores does not stop indexing, because macOS starts them again and they pick up where they left off. If you have Vitals' optional helper enabled, its 30 days of per process history make it easy to see whether indexing is winding down or coming back every day.

Questions people ask

What is mds_stores on Mac?

It is one of the processes that maintains the Spotlight search index. It is part of macOS.

Why is mdworker running so much?

mdworker scans new and changed files for Spotlight. It runs a lot after an update, a migration, or when many files change, and quiets down once indexing catches up.

Is it safe to quit mds_stores?

Quitting it does not help much, because macOS starts it again and indexing resumes. To stop indexing a location, add it to Search Privacy in Spotlight settings.

What is mdworker_shared?

It is the name of the Spotlight worker process on recent versions of macOS. Like mdworker, it scans files and passes what it finds to mds for the index.

How do I know when Spotlight indexing is done?

mds_stores and the mdworker processes drop to little or no CPU in Activity Monitor and stay there. Their Bytes Read in the Disk tab also stops growing.

Does Spotlight index external drives?

Yes, when they are connected, unless you add them to Search Privacy. Run `mdutil -s /Volumes/DriveName` to see the indexing status of a drive.

Related

Looking for something better than Activity Monitor? See the best Activity Monitor alternatives for Mac, or browse every term in the glossary.