I'm building out a new photo gallery and I'm looking at different DB designs. 
The gallery will have pictures on a per person basis as well as a per event 
basis. I was thinking the following table for the pics:
imageid int primary
userid int primary
imagetype tinyint primary
imagename nvarchar
description text
height int
width int

Note the imageid, userid and imagetype all being primary. I'm thinking that I 
can have the following example data:
image 1 for userid 1 is a personal image (imagetype 1)
image 2 for userid 1 is a personal image (imagetype 1)
image 1 for userid 1 is an event image (imagetype 50 for cfunited)
image 1 for userid 1 is an event image (imagetype 49 for powered by Detroit)
image 2 for userid 1 is an event image (imagetype 49 for powered by Detroit)
This would mean that I have an exact lookup for each user's images per type. Is 
this efficient?
The normal way of doing this is to have a single imageid as an incremental int 
or by having a separate table for personal and event images. 
Your thoughts?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2314
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to