setting up a database .. which is better??

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

setting up a database .. which is better??

Post by tsg »

Hello,

Forgot my user name, so this is a new one. I am FINALLY taking time to learn MySQL database.

As my first project, I am setting it up so I can keep track of affiliates and clicks and stuff. What I want to do is keep track of how many clicks, time, date, page clicked from, etc...

So in my first (successful) table, I have the info such as ID, title, url, image location, etc... I am wondering would it be better to have:

A) 1 table that has the information: time, date, page, affiliate ID in it and query by ID

OR

B) create a table for each affiliate link and keep track of that information.

I know I could queary either way, just which would be more efficient??

I have been doing flat file database programming for a while, and I have to say this MySQL thing looks so my easier and more efficient!!! I can't believe I have waited so long to get into it!
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

i would say go with the single table where each row as the information for each affiliate.
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

Post by tsg »

after I wrote the post, I was thinking that would be the best way. But is there a certain point where a table can get too big?

If I have 200 entries a day, that would be 1400 in a week. Would it be better to create a new table each day (via script) .. or is size of the table an issue ..

Thanks,
Tim
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

nope, size isn't a realistic problem. DB servers are designed to handle insanely large tables so that you don't have to :). but if you still want to worry about size you might think about prunning options similar to what the phpBB (eg. this forum) system does, which is to delete old entries every once and in a while.
User avatar
Elmseeker
Forum Contributor
Posts: 132
Joined: Sun Dec 22, 2002 5:48 am
Location: Worcester, MA

Post by Elmseeker »

Yeah, I think most modern DB's can handle like 64 million+ entries in a single table...if you hit that many...well...you should be filthy rich from the ad revenues alone!
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

Yep,

DB2 can handle TERRABYTES, as can other Enterprise-Grade DBMS' like
Oracle and such....

MySQL may not have all the whistles and bells, but it is FAST!

Phil J.
Post Reply