How to handle huge select query with symfony and doctrine?

廉价感情. 提交于 2019-12-25 07:49:46

问题


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



来源:https://stackoverflow.com/questions/8800978/how-to-handle-huge-select-query-with-symfony-and-doctrine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!