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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:17:31+00:00 2026-05-23T19:17:31+00:00

I am working on the web application developed in ASP.Net using C#. Allong with

  • 0

I am working on the web application developed in ASP.Net using C#. Allong with other feature, there is a feature which allow users to add various items to their personal list. The database tables relevant to above features are:

-------------------------
| Item                  |
-------------------------
| ItemId (Primary Key)  |
| . . . & other attribs |
-------------------------

---------------------------
|List                     |
---------------------------
|ListId (Primary Key)     |
|. . . and other attribs  |
---------------------------

Since there is many to many relationship among above two table (i.e One Item is added in many lists and one list contains many items) So i create third table for that

---------------------------------
|ItemList                       |
---------------------------------
|ItemId (Foreign Key)           |
|ListId (Foreign Key)           |
|. . . and other Attributes     |
---------------------------------

Now, I in need to maintain track that how many times a certain item is added in the list. In order to acheive this i have two possible options

  1. I add a new attribute in Item table and increment that value with one every time when a particular item is added to a certain list.
  2. The second option is that whenever i need to know that how many
    times a particular item is added in the list, then i will apply the
    SELECT Count Query (with where clause) on the ItemList table

Please suggest which approach is better and why? I am more declined towards the second approach, and regarding efficency i guess both have same

  • 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-23T19:17:32+00:00Added an answer on May 23, 2026 at 7:17 pm

    Option #1 will perform better for read operations because the count has already been aggregated. The downside to this approach is that you must:

    • Manually update this number yourself for every insert and delete across your application.
    • Update this number every time an item is added to the list. If you’re application write to read ratio is high it might not be worth the effort

    Option #2 will perform better if you’re application has more insert/deletes compared to reads. The reason for this is that SQL Server only needs to calculate the count when it is needed.

    I would suggest going with option #2 unless you have identified performance issues that would make you want to take a different approach.

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

Sidebar

Related Questions

I'm working in a web application using VB.NET. There is also VisualBasic code mixed
I am working on a web application (ASP.NET) game that would consist of a
Scenario : I have an ASP.NET MVC application developed in Visual Studio 2008. There
I have an ASP.NET application that is installed using a Web Deployment Project. I'd
I am working on a web application using Python (Django) and would like to
I am working on a web-application in which dynamically-created images are used to display
I am working on a web application in Java which gets data from servlets
The project is developed using ASP.NET MVC framework and heavily relies on .NET 3.5.
I am working on a asp.net web site, like normal user, we use asp.net
I'm working on a web based application that belongs to an automobil manufacturer, developed

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.