What I had experienced that the media indexing process used quite some resources after there were file transactions like after an update or file transfer to the phone. One time it drained my fully charged battery within a few hours after I had transferred a few GBs of small files to the phone. It needed several hours to index them and at least on Lollipop it seems to run on high priority.
Maybe this is the effect with your phone and it calms down when finished. I am not sure if there was a change on Marshmallow concerning this process or the priority.
In this thread https://forum.fairphone.com/t/fp2-battery-problems-drains-quickly-cpu-gets-hot-see-batteryguide-for-workarounds/12334/229
I followed the hint of @media_rw placing empty “.nomedia” files in all folders I did not wanted to be indexed (neglect system folders like ringtones/notifications also pictures etc.).
This works fine for me and the media process only takes care of system files.
You could lookup the running media process and monitor its behavior if listed. Maybe that´s the explanation.