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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:06:50+00:00 2026-05-14T07:06:50+00:00

I am trying to design a tagging system with a model like this: Tag:

  • 0

I am trying to design a tagging system with a model like this:

Tag:
   content = CharField
   creator = ForeignKey
   used = IntergerField

It is a many-to-many relationship between tags and what’s been tagged.

Everytime I insert a record into the assotication table,
Tag.used is incremented by one, and decremented by one in case of deletion.

Tag.used is maintained because I want to speed up answering the question ‘How many times this tag is used?’.

However, this seems to slow insertion down obviously.

Please tell me how to improve this design.

Thanks in advance.

http://www.pui.ch/phred/archives/2005/06/tagsystems-performance-tests.html

  • 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-14T07:06:51+00:00Added an answer on May 14, 2026 at 7:06 am

    If your database support materialized indexed views then you might want to create one for this. You can get a large performance boost for frequently run queries that aggregate data, which I think you have here.

    your view would be on a query like:

    SELECT
        TagID,COUNT(*)
        FROM YourTable
        GROUP BY TagID
    

    The aggregations can be precomputed and stored in the index to minimize expensive computations during query execution.

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

Sidebar

Related Questions

I am trying to so something like Database Design for Tagging , except each
I'm trying to design a button for an android application like this: The length
I'm trying to design a gmail like thread messaging system on Google App Engine
I'm trying to design a model for a application allowing 2 people to bet
I've been trying to design support for recurring events (like you would see in
I'm trying to design a data model that denotes one user being the friend
I'm trying to design an easily extendable form system in javascript, but am having
I'm trying to design a set of factory classes for our system, where some
I'm trying to design a two factor authentication system (on PHP) using SMS as
I am trying to design an entity model using JPA2.0 via hibernate. I have

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.