Closed OtterlyOlive closed 9 years ago
Is this because of the search plugin or ... I'm not sure what the problem is. :/
Try getting the results without using the search plugin and see if the results are the same. If so, then you should look into optimizing your query, reducing or limiting results, pagination, reducing fields return, adding database indexing to foreign keys, etc.
Right, sorry @antoniovassell :)
If I remove the 'searchable' behaviour in both the model and the controller, it is back to the "right" speed (@ ~3000 ms)
I have "solved" the problem by simply not containing it (it wasn't needed anyway) but wanted to report the undesirable behaviour :)
It is more a core issue, not a search plugin issue. You should open a ticket at the core if you can find some more evidence of what causes this. But the plugin just uses contain, and has to do some left joins in order to get associated data. Nothing it can do here at this point IMO.
Guess we can close
I have the following code in my controller:
And in my Projects Models' Initialize:
Containing the "ParentProjects" causes a significant slowdown on pageload.
From ~3000 ms to ~108000 ms