18k files is a lot, I could certainly see that being a problem. You should try excluding folders via Project preferences > Files and directories to exclude. Or decrease the maximum directory depth of Preferences > Code Intelligence > Code Scanning.
That said, issues like this is why we’re overhauling codeintel.
I think you’re right, it go to slow 'cause i work on big project, i have try to work on small project and the error don’t happen but when i try option in Code Scanning follow your step and back to work with my big project it just increase to 50 or more than 1 hour then the error still happened