图像数据库设计 [英] Database design for images

查看:128
本文介绍了图像数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计我的数据库结构,我需要一些建议:我有可以从类别中选择的图像,其他人可以上传,对于每个伙伴,我应该保存选择的图像...



i有几种选择:



1-i可以将上传的图像和预定义的图像放在同一张桌子上并放置一面旗帜区分它们,我知道使用标志可能有风险..



2-i可以将上传的图像和预定义的图像放入2个不同的表中但是在那种情况,如果我需要将选择的图像的id放在好友表中,我将无法知道从哪个表中给出了这个id(因为图像id是递增的整数)



所以我该如何设计呢?哪个方法更好,为什么?

I'm designing my database structure and i need some advice: i have images that can be selected from categories and others can be uploaded and for every buddy i should save what image was selected...

i have several options:

1-i can put the uploaded images and the predefined images into the same table and put a flag to differentiate between them, and i know that using flags might be risky..

2-i can put the uploaded images and the predefined images into 2 different tables but in that case if i need to put the id of the image selected in the buddy table i will not be able to know from which table this id was given (because the image id is an incremented integer)

so how can i design this? and which method is better and why?

推荐答案

嗨Jocelyne,



我希望第二种方法是我的从性能角度考虑,在sql服务器上承担更多负担,在开发应用程序时,开发人员需要更多代码。第一种方法最优选而不是第二种。



谢谢,



Coded007
Hi Jocelyne,

I hope 2nd method my be take more burden on the sql server as we think from performance perspective and it will take more code to developer while developing the application. 1st method is most preferable instead of 2nd.

Thanks,

Coded007


这篇关于图像数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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