MorphToSelect is too slow
MorphToSelect for reading from large database is too slow. Is there any better alternative or any approach i can apply for chunking here. I have Member model which has MorphOne relationship with Company and User models. I need to select member in lets say LeadResource. Below is the code:-
3 Replies
Have you got indexes setup?
yes i have name field set as index in both Company and User model.
I realised using Preload() is the problem. I removed and I see significant jump. But still i was wondering if i am using preload() with ->optionsLimit(5), then there should not be an issue but i see my page just hangs when i try typing .
No there shouldn't really, use telescope and inspect the slow downs etc