Jump to content

New to SQL, one table or many?


proggR

Recommended Posts

I have my site working right now the way I expect it to but I'm saving and loading all my information to text files (the only information I have is paths to files that get included).

I wasn't going to go with a database (mainly because I'm on dialup at home and didn't want to download MySQL), but now that I'm thinking about it, it'll be easier to do it now than it would at a later date (although I guess I could write a script that would just write what I have in text files to tables, but that's beside the point). Anyway, to the point.

Right now I have it setup so when a new entry is posted, its path is recorded in a file called all.txt and a file that is course.txt (where course is the actual course or keyword that I'm using, so there will be many different ones). So when I change to a database should I just have one table and use:

SELECT Course FROM Entries WHERE Course='The Course'

Or would it be better to do it the way I have now with a separate table for each course and a master table and use:

SELECT * FROM Course

 

Many tables would obviously take more space but I could see it having faster seek times.

I'm sure either way would be fairly easy to adapt, I was just wondering if the faster seek times is 1-true and 2-noticable after a large amount of values have been entered (1-2 daily).

Link to comment
Share on other sites

Oh. Also, the posts will be organized into pages that will obviously need to change what content is displayed based on the newest information. Would it be best to only load the five most recent entries from the DB and only query the next five if the viewer requests the next page, or to query the DB once and load all the entries into memory to be viewed. The entries are, as I mentioned, just paths to the file to be included so they wouldn't take up a lot of space but I don't know which outwieghs the other on server stress, loading things to memory or querying the DB over and over.

Thanks again.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.