If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Design question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-06-04, 15:34
noof noof is offline
Registered User
 
Join Date: Jun 2004
Posts: 2
Design question

Hi, I'm creating a stats script for a webpage and I've ran into a problem when storing the data. For example I want to log which browser plugins the visitors have, but I don't know how to store it. The most natural way to do it is to have a "Plugin" table with a "date" column and one column for each plugin and then add 1 in the right column/date. But the problem is that I don't know which plugins the users have, so that table would have to grow on the width, which for me seems a bit "ugly" Do you have any ideas?

Maybe you could have a "Plugin" table with plugin-id and plugin-name and a table with "date","plugin-id","count" ? then you would get a row per date and plugin which is not very good since I want to save hourly stats, which makes #plugins*24*365=#plugins*8760 rows/year (#plugins ~= 10-15), is it too much? any other brilliant ideas?
Reply With Quote
  #2 (permalink)  
Old 06-07-04, 13:48
numLocked numLocked is offline
Registered User
 
Join Date: May 2004
Posts: 9
can't you just use your second colution and periodically dump the data from the db? just tally it all up once a month and dump that data out and then you've cut the number of rows by a factor of 12. hell, do it once a week if you need to.
Reply With Quote
  #3 (permalink)  
Old 06-07-04, 14:26
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,413
It appears you are confusing data collection with data reporting.
CREATE TABLE WEB_ACCESS
(
PLUGIN_NAME VARCHAR(255) NOT NULL,
ACCESS_TIME DATETIME NOTNULL
);

This table get 1 record for each access.
You can report the results any which way is required with simple SQL.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
  #4 (permalink)  
Old 06-07-04, 15:50
noof noof is offline
Registered User
 
Join Date: Jun 2004
Posts: 2
thanks for the replies! sounds like a good idea to dump it to the disc.. the only bad thing is that the user will have to do it every once in a while.. or maybe you can force him to do it.. can't take too long to dump it.. hmm.. we'll see..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On