For my database that works well, I have 147 items in the root of the Database.
For my Global Inbox, I have used it too long as a “miscellaneous everything box” and it has 3949 items.
So your point to me will be to reorganize that so I have only a few items at the root of the Global Inbox and I move all else to a “Miscellaneous Whatever” Group or similar inside the Global Inbox (or move it elsewhere).
Nearly 4000 files that are loaded ad-hoc in the Files app unfortunately break Files’ limit of maximum 40 MB of RAM per extension. With fewer items in one group or the database root it should work. We have this on the radar but we don’t know if we can bring the memory consumption further down.