Page 1 of 1

setting up a database .. which is better??

Posted: Sun Jan 12, 2003 9:22 pm
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!

Posted: Mon Jan 13, 2003 1:20 am
by mydimension
i would say go with the single table where each row as the information for each affiliate.

Posted: Mon Jan 13, 2003 8:59 am
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

Posted: Mon Jan 13, 2003 7:53 pm
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.

Posted: Mon Jan 13, 2003 7:56 pm
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!

Posted: Mon Jan 13, 2003 8:20 pm
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.