WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Recently Popular] Why adding db row prt each page view ? (3 posts)

  1. saharusa
    Member
    Posted 4 years ago #

    In terms of months or years it means too many rows.

    In my opinion, table should look like this:

    ts (DATE)
    user_type
    post_id
    hits

    we loose ability to show post from last X hours but table will end up much smaller.

    http://wordpress.org/extend/plugins/recently-popular/

  2. ebiven
    Member
    Posted 4 years ago #

    Some people may want the hourly data. Even then you could aggregate by timestamp if you wanted to aggregate. I didn't want to aggregate. I wanted the most accurate representation possible. I even warn people with very busy blogs to not use this plugin.

    The plugin now allows you to purge data from the table through a settings page in the admin. Additionally, the table is indexed and the plugin first selects out only the rows that match the time criteria, making it very efficient as long as you use a reasonable timespan. Don't do "most popular for the last year" and you'll be fine in almost all cases.

    Finally, the plugin is licensed under the FreeBSD license precisely because I knew that it wouldn't do what everyone wanted. It can't be all things to all people. The FreeBSD license is as liberal as they come. Take it, make a fork, and make any changes you want. That's part of the beauty of open source.

  3. natarem
    Member
    Posted 4 years ago #

    FYI I took an older version of this plugin and paid a guy on RAC to make a new table which caches the data every hour. The cache refresh gets called on pageload so basically there's one semislow pageload per hour. I'm doing a 30 day timeframe on a pretty busy blog/news site fwiw. I can share the code but it won't work with the latest version of the plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic