从数据库中为用户随机且不重复地获取唯一的照片
我正在尝试创建一个网站,该网站随机检索用户的照片,并且不会重复特定用户的照片,直到用户看到所有照片并初始化该用户的记录。
我想为每个用户和照片(已保存 URL)表建立一个 user_photo 表,该表指定用户是否已经看过该照片,但如果有很多用户和很多照片,这将是一个巨大的记录。
我的问题是是否有更好的设计来更快、更高效地检索数据。
我看到了其他问题,但与特定用户处理无关。
I am trying to create a website that retrieves photos for users randomly and without repetition for specific user, till the user see all the photos and init the records for the user.
I thought to have for each user and photo(URL saved) table, a user_photo table, that specifies if the user already saw the photo, but in case of many users and many photos, this will be a huge record.
my question is if there is a better design to retrieve data faster and efficient.
I saw other questions but not related to specific user handling.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这肯定会对您有很大帮助...
编辑
以下是我的建议......
希望这会对您有所帮助......
This will definitely help you alot...
EDIT
Below is my suggestion....
Hope this will help you....
之一
无论哪种方式,都没有优雅的解决方案......
"Without repetition" means keeping state, which means one of
Either way, there is no elegant solution...