Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Suggestions on Image Gallery DB design.

Author  Topic 

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2007-12-13 : 10:31:55
For a long time now I have been using SQL 2005 to hold information about images for different image galleries. I have going though and rebuilding the site from the ground up and thought this might be a good time to optimize the tables and databases. Right now each game has it's own table in the database to hold information about the images (Group, ImageName, Width, Hight, AltTag, ImageNumber [Group is to split up by character, ImageNumber is a unique number for each image so I can use it to pull into the ASP script to create the thumbnail and internal linkings from image to image]). I was going to stick with this design but decided I would pop in here and see if anyone has any suggestions on a better way of doing this? And remember I am recreating all the scripts so the gallery script used to generate the HTML page for the users can be modified to work with the new DB.

Here is the code to create the current tables for anyone that wants to look at how I made the original ones.

CREATE TABLE [Eaglef90].[cbr](
[GroupName] [varchar](15) NOT NULL,
[ImageName] [varchar](50) NOT NULL,
[Width] [decimal](3, 0) NOT NULL,
[Height] [decimal](3, 0) NOT NULL,
[AltText] [varchar](50) NOT NULL,
[ImageNumber] [decimal](3, 0) NOT NULL
) ON [PRIMARY]

--
If I get used to envying others...
Those things about my self I pride will slowly fade away.
-Stellvia

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2007-12-14 : 23:54:34
I just ran across this article on the site and it is telling me I am on the right path for my DB layout

http://www.sqlteam.com/article/images-and-sql-server

My question now becomes do you think I should split the categories up into multiple tables? Right now each Final Fantasy game/movie has it's own table. My concern with putting them all into one table is the size of that table. I have over 1500 images right now and that covers only a small percentage of the total amount of games/movies that will have images. I am still on the right path with using multiple tables for each game/movie or should I not worry about having them all in one large table?

--
If I get used to envying others...
Those things about my self I pride will slowly fade away.
-Stellvia
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-12-15 : 00:37:54
definitely don't have a separate table for each game/movie/whatever. put them all in the same table.




elsasoft.org
Go to Top of Page

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2007-12-15 : 21:20:20
quote:
Originally posted by jezemine

definitely don't have a separate table for each game/movie/whatever. put them all in the same table.




elsasoft.org


Thanks, how many entries can I have in a single table before worrying about performance issues?

--
If I get used to envying others...
Those things about my self I pride will slowly fade away.
-Stellvia
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-12-15 : 21:28:42
if the table is indexed properly, you can have many millions.

I've got a couple tables with over 1 billion rows, although they are read-only.


elsasoft.org
Go to Top of Page

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2007-12-15 : 22:00:47
quote:
Originally posted by jezemine

if the table is indexed properly, you can have many millions.

I've got a couple tables with over 1 billion rows, although they are read-only.


elsasoft.org


Wow, cools. I will definatly need to brush up on indexing before making this table to make sure I do it right.

--
If I get used to envying others...
Those things about my self I pride will slowly fade away.
-Stellvia
Go to Top of Page
   

- Advertisement -