Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6837815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:31:19+00:00 2026-05-26T23:31:19+00:00

I’m working on a stats project, in which we are interested in recording different

  • 0

I’m working on a stats project, in which we are interested in recording different events about different listings on a website.

An example of an event would be “click on logo”, “click on more info” and etc, each event is going to be represented by a number, that I’m calling eventid.

There are going to be around 20,000 events that need to be stored in this table per day, so for 5 years, somewhere around 18,000,000 rows will be in this table.

Here is what I have in mind:

CREATE TABLE IF NOT EXISTS `stattableindexed` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `lid` int(10) unsigned NOT NULL COMMENT 'Listing ID',
  `serviceareaid` int(10) unsigned NOT NULL COMMENT 'Service Area ID',
  `domainid` int(10) unsigned NOT NULL COMMENT 'Domain ID',
  `bizgroup` int(10) unsigned NOT NULL COMMENT 'Business Group',
  `eventid` int(10) unsigned NOT NULL COMMENT 'Event ID',
  `eventtype` int(10) unsigned NOT NULL COMMENT 'Event Type',
  `count` int(10) unsigned NOT NULL COMMENT 'Count of Events',
  `timeunitid` bigint(10) unsigned NOT NULL COMMENT 'Time units',
  PRIMARY KEY  (`id`),
  KEY `timeunitid` (`timeunitid`),
  KEY `lid` (`lid`),
  KEY `serviceareaid` (`serviceareaid`),
  KEY `domainid` (`domainid`),
  KEY `bizgroup` (`bizgroup`),
  KEY `eventid` (`eventid`),
  KEY `eventtype` (`eventtype`),
  KEY `count` (`count`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Timeunit is going to be a unix epoch time, for a day, so I’m only keeping the count of events of the same kind for every day.

This way I can query the table for a range of days.

Do you think this is a good idea?
If not what is a better way of doing it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:31:20+00:00Added an answer on May 26, 2026 at 11:31 pm

    Have you considered using a NoSQL solution for performance reasons? i.e MongoDB It’s a great tool for these kind of large scale logging dbs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I would like to run a str_replace or preg_replace which looks for certain words
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.