random1 Posted August 31, 2008 Share Posted August 31, 2008 Hey All, I have a MySQL database table currently recording a record each time a user visits the site (the date and time, the browser, OS, page they visited etc). I can tell that this will become a very big table when many users hit the site. The ID for the table is currently bigint(255). Is there a better data type I should use? Should I put in place an archiving system for this table since it's going to be so HUGE? What's the best way to handle a table that you know will be full of data? ( > 15000 records) Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted August 31, 2008 Share Posted August 31, 2008 I guess if you're really worried you could, at the end of each month, have another table and just add the monthly hits to it. Quote Link to comment Share on other sites More sharing options...
dannyb785 Posted August 31, 2008 Share Posted August 31, 2008 most servers and hosting providers already give this information. For my client, I'm more concerned about how many "visits" the site gets instead of each individual page view. So every time I get a new "visit"(basically, when a new session is created) I create a session variable and then on the next page hit, I check if the session variable has been created. if not, I add a database entry. if so, I don't. Of course, a user can just exit the window and revisit the site and it'll count as a new visit so I have a checker to see if xxx ip and yy browser have visited in the last zz seconds. I also validate ip's(make sure they're formatted correctly) bc ip spoofing can render my method useless Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.