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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:13:44+00:00 2026-05-15T09:13:44+00:00

With reference to this post: How to implement tag counting I have implemented the

  • 0

With reference to this post: How to implement tag counting

I have implemented the suggested 3 table tagging system completely. To count the number of Articles per tag, i am using another column named tagArticleCount in the tag definition table. (other columns are tagId, tagText, tagUrl, tagArticleCount).

If i implement realtime editing of this table, so that whenever user adds another tag to article or deletes an existing tag, the tag_definition_table is updated to update the counter of the added/removed tag. This will cost an extra query each time any modification is made. (at the same time, related link entry for tag and article is deleted from tagLinkTable).

An alternative to this is not allowing any real time editing to the counter, instead use CRONs to update counter of each tag after a specified time period. Here comes the problem that i want to discuss. This can be seen as caching the article count in database. Can you please help me find a way to present the articles in a list when a tag is explored and when the article counter for that tag is not up to date. For example:
1. Counter shows 50 articles, but there are infact 55 entries in the tag link table (that links tags and articles).
2. Counter shows 50 articles, but there are infact 45 extries in the tag link table.

How to handle these 2 scenerios given in example. I am going to use APC to keep cache of these counters. Consider it too in your solution. Also discuss performance in the realtime / CRONNED counter updates.

  • 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-15T09:13:45+00:00Added an answer on May 15, 2026 at 9:13 am

    It all comes down to the needs of your application. How crucial is it for the information to be up to date? In most cases, I would think that it would be worth the extra query to have real-time data.

    I actually recently faced the same challenge on a system I am developing, but ultimately decided that the solution which used a field for storing a tag-count would not work. It might be worth considering the reason I went another way, in case it is applicable to your situation:

    With the field-based method, you only have one count available. For my system, I wanted to be able to have several levels of depth available. So, using the tags on this article as an example, I wanted to know more than the overall counts of ‘php’, ‘mysql’, ‘best-practices’, ‘performance’, and ‘tagging’. I also wanted to know the counts of various combinations.

    The solution I went with was to use a count(*) as follows:

    SELECT count(*)
    FROM items i, categories c
    WHERE c.Id = i.Id
    AND (c.category IN ('php', 'mysql', 'tagging'))
    GROUP BY i.Id
    HAVING COUNT( i.Id )=3
    

    To mitigate the possibility of this getting slow, I use AJAX to populate the page segments into which the related data is displayed.

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

Sidebar

Ask A Question

Stats

  • Questions 515k
  • Answers 515k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer From this thread I understand that one needs to inform… May 16, 2026 at 6:31 pm
  • Editorial Team
    Editorial Team added an answer Moving the static content(javascript, css, images) to a 3rd part… May 16, 2026 at 6:31 pm
  • Editorial Team
    Editorial Team added an answer The interesting ones are in deploy/messaging/jms-ds.xml java:/JmsXA - "use this… May 16, 2026 at 6:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

This post reference to the One Definition Rule. Wikipedia is pretty bad on explaining
With reference to this programming game I am currently building. Thanks to the answers
UPDATE - No need to answer this now, I have solved below. Hi, I'm
I have a model with a reference property, eg: class Data(db.Model): x = db.IntegerProperty()
I'm not the first to have these issues, and will list some reference posts
This question relates to my other post . Ok so after a bit more
I'm working on an HTML form that will post data to my Webserver for
Currently I have the function CreateLog() for creating a a log4net Log with name
I need to implement fine-grained access control in a Ruby on Rails app. The
Please help me implement access control lists for my PHP web application. I'm using

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.