• Visitors can check out the Forum FAQ by clicking this link. You 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. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Noob MySQL question - handling hostorical data (website stats)"

Collapse

  • Freamon
    replied
    Is this currently an operational database where the data is just updated whenever it changes, rather than a new row being inserted?

    If so, you could create a separate table and then take a "snapshot" of all the data by running a weekly script to copy the data into that table and add a timestamp.

    Leave a comment:


  • yorkshireman
    replied
    Originally posted by Jog On View Post
    Thanks for that. Will it create a new row for each week and leave the previous rows as they were?
    It will import a new row each time the script is run.

    Depending how much of a programmer you are, you may be better looking at a free tool for web stats like AWSTATS. It can automatically query webserver and write stats away to mysql.
    Last edited by yorkshireman; 21 February 2011, 12:06.

    Leave a comment:


  • minestrone
    replied
    I would have an audit table and set a trigger on update of the table to insert a new insert on the audit table. Probably the way I would do it.

    Leave a comment:


  • Jog On
    replied
    Originally posted by yorkshireman View Post
    Hi Jog On,

    I would have a field in the table called resultsdate make it a timestamp field. This will auto populate with the current time/date whenever you load data.
    Thanks for that. Will it create a new row for each week and leave the previous rows as they were?

    Leave a comment:


  • Spacecadet
    replied
    All I can answer that with is a lot of questions!

    To save me shooting in the dark, I'll give you a break down of what you should be doing

    Your best method will be to start off with building some prototype charts and graphs.
    From these you can extract what you want to measure and the attributes which those measured will be grouped against.
    Attributes will build into members - logical groups of members and from there you can build a hierarchy
    By now you should be getting towards something that looks like a dimensionalised database.

    Once you've got a semi decent logic and physical model you can then start to think about historical attributes.

    Sounds like a lot of work but if you do it properly you'll see the benefits

    Leave a comment:


  • yorkshireman
    replied
    Originally posted by Jog On View Post
    I'm building a MySQL database to store information on my websites such as traffic stats (from Google analytics), lead conversions and affiliate sales.

    I've been searching and searching but can't find any useful info on how to best handle the historical data (I probably don't even know the search terms I should be using).

    I want to update the DB each week and be able to keep the historical data so I can measure ongoing performance and draw my own graphs etc just like Google analytics but with conversion and revenue data as well.

    What's the most effective and efficient way to update the DB each week and retain the previous data in each table? Some fields won't be updated but some will.
    Hi Jog On,

    I would have a field in the table called resultsdate make it a timestamp field. This will auto populate with the current time/date whenever you load data.

    Write a script to get your results preferably in csv format then call mysqlimport to import into your table.

    Use cron to run your script weekly

    Leave a comment:


  • Noob MySQL question - handling hostorical data (website stats)

    I'm building a MySQL database to store information on my websites such as traffic stats (from Google analytics), lead conversions and affiliate sales.

    I've been searching and searching but can't find any useful info on how to best handle the historical data (I probably don't even know the search terms I should be using).

    I want to update the DB each week and be able to keep the historical data so I can measure ongoing performance and draw my own graphs etc just like Google analytics but with conversion and revenue data as well.

    What's the most effective and efficient way to update the DB each week and retain the previous data in each table? Some fields won't be updated but some will.

Working...
X