How to handle huge select query with symfony and d

2019-09-09 11:31发布

问题:

For example, i have playlist of 5000-10000 videos, what is the best way to select and show those videos in list. Pager is not an option, I need to have all of them becouse sorting and other functionalities?

I thinking about solution to load list while scrolling the playlist, but this make me another problem, if i dont have all videos loaded, i can not properly save playlist.

All suggestions/proposals are welcome...

回答1:

use a dynamic pagination i.e, dont bring every thing to the frontend, bring a bulk around 100 in the first time and render the first 10 and when the user reaches to 80 th item call the next 100 asynchronously. Using this the response time wont be hampered neither the DB hit. Hope this will help