laravel-nestedset
laravel-nestedset copied to clipboard
withDepth() and having() causing performance issues
I am using the following query to get the specific level of rows:
return File::withDepth()->having('depth', '=', $currentDepth)->get()->toTree();
After hitting a certain amount of records (currently there are about 20k in total in my database) the mySQL CPU went straight to hell with that query.
Is this a known issue or is there any alternative which I can use which is more performant to achieve that task?
@matthiascw running into the same issue with ~ 30K items. Have you ever found a way around this?