I have had a lot of problems with OneDrive over the years but this one was a real doozy. I created a directory with 200,000 items in a directory that is backed up by OneDrive. This cause issues with OneDrive and fileproviderd that prevented me opening files, deleting files, moving files … It would also cause OneDrive and fileproviderd to jump to more than 100% cpu usage and slow the machine to a crawl. Of course, I moved the directory out of the folder managed by OneDrive but that did not seem to help.
My original solution to the problem was to delete the databases for the fileproviderd service within the ~/Library/Application\ Support/FileProvider directories which seemed to help. However, later I noticed that OneDrive was still trying to upload the files from the moved directory. That was when I discovered the ~/Library/Application\ Support/OneDrive/settings folder in which there were multiple FileSyncFSCache.db files which I nuked with rm -rf FileSyncFSCache.db*