如何使用symfony和doctrine处理巨大的选择查询? [英] How to handle huge select query with symfony and doctrine?

查看:142
本文介绍了如何使用symfony和doctrine处理巨大的选择查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我有5000-10000个视频的播放列表,什么是选择和列出这些视频的最佳方法。传呼机不是一个选择,我需要让所有的人都排序和其他功能?



我在考虑在滚动播放列表时加载列表的解决方案,但这使我另一个问题,如果我没有加载所有视频,我无法正确保存播放列表。



欢迎所有的建议/建议...

解决方案

使用动态分页,即
不要把每件事情都带到前端,第一次大约100个,渲染前10个当用户到达第80个项目时异步调用下一个100。
使用这个响应时间不会阻碍DB命中。
希望这将有助于


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...

解决方案

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

这篇关于如何使用symfony和doctrine处理巨大的选择查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆