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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:54:37+00:00 2026-05-13T15:54:37+00:00

sorry if the title is not very clear. I will try to explain now:

  • 0

sorry if the title is not very clear. I will try to explain now:

I have two tables: table A and table B. The relation between them is one (for A table) to many (for B table). So, it’s something like master-detail situation.
I have a column ‘Amount’ in table B that is obviously decimal and a column ‘TotalAmount’ in table A.
I’m trying ti figure out how to keep the value in table A up to date. My suggestion is to make a view based on table A with aggregate query counting the Amounts from table B. Of course with the proper indexes …
But, my team-mate suggest to update the value in table A every time we change something in table B from our application.
I wonder, what will be the best solution here? May be a third variant?

Some clarification … We expected this tables to be the fastest growing tables in our database. And The table B will grow much much faster than table A. The most frequent operation in table B will be insert … and almost nothing else. The most frequent operation in table A will be select … but not only.

  • 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-13T15:54:37+00:00Added an answer on May 13, 2026 at 3:54 pm

    I see a number of options:

    1. Use an insert trigger on table B and do the updates table A as your friend suggests. This will keep table B as up to date as possible.
    2. Have a scheduled job that updates table A every x minutes (x = whatever makes sense for your application).
    3. When updating table B, do an update on table A in your application logic. This may not work out if you update table B in many places.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry the title is not very clear. This is a follow up to my
Sorry if the title is not very clear. I was not sure about the
Sorry for the not very descriptive question title. I'm not very sure how to
Sorry for a long question and not a very descriptive title, but my problem
Sorry about the title. I do realize it's not very descriptive. :| Here is
sorry for that title but it is very hard to explain in a few
First off, I'm sorry if the title doesn't explain this very well. I'm looking
Sorry if title is not too clear but I think it's about right. NEhow,
Sorry for the slightly rubbish title. I could not think how to describe this
I'm sorry I could not think of a better title. The problem is the

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.