im working on polls script
i have 3 tables which are polls , options , answers
i have 942 poll ,, 10 options for each poll ,, and around 5000 answer for each option in
the problem comes with calling data using eager loading
the request takes too long ,,
any ideas for optimizing the script?
More than likely this comes down to your database design, and how things are indexed. Are all of your foreign keys indexed? That's the main thing. Are things you are using in where statements indexed? It would help to show the schema of the tables involved.
And why would you load 942 polls, along with all of their options/answers in a single request? Normally you'd use pagination and only load like 10 or whatever at a time? That's crazy lol.