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 6711721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:10:29+00:00 2026-05-26T08:10:29+00:00

I want to log access to pages in my PHP/MySQL app to implement a

  • 0

I want to log access to pages in my PHP/MySQL app to implement a view count similar to the one on SO.
My plan is to count the requests by unique IP addresses on each page. There about 5000 different pages with a view-count.
(I know counting IPs is not exact but that is OK for my purposes.)

I see two options to do organize the database tables:

  • Either one large table with the fields “page_id”, “request_ip”. Assuming each page has 50 views by unique IPs on average, I’d get 5000 x 50 = 250 000 rows. As the views are displayed on the pages, the table will have read and write access for each request on each page.
  • The other option is to have one table per page with a single column “request_ip”. I’d then have 5000 tables storing 50 rows on average. A table will only get accessed when it’s page is viewed.

Which one is better generally and performance wise? Or am I completely on the wrong track?

  • 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-26T08:10:29+00:00Added an answer on May 26, 2026 at 8:10 am

    5000 tables means 5000 different queries + 5000 different sets of index + 5000 different sets of data competing for space in the server’s caches. Performance will most likely be abysmal.

    Multiple tables storing exactly the same data structure is almost ALWAYS a bad design. If you’re worried about performance, you can use MySQL’s partitioning support to split the table into multiple pieces automatically, and that’s done transparently to the end-user (eg. your queries).

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

Sidebar

Related Questions

I want to implement a basic login system in some PHP app where no
I want to parse an Apache access.log file with a python program in a
i have an application and a user must log-in before he/she can access pages.
I want to access one site that first requires an (tomcat server) authentication and
i want log linenumber to my log file, using log4net.the config details of log4net
I want to log onto Stack Overflow using OpenID, but I thought I'd set
I want to log user's actions in my Ruby on Rails application. So far,
I want to log to the console when I'm using un-minimized JavaScript files. Comments
I want the log to roll over as long as the application is running,
I want to log all exceptions server side . In ASP.NET I write something

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.