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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:38:00+00:00 2026-05-15T21:38:00+00:00

Boiled down: Is it better to have the calculated field returned with the rest

  • 0

Boiled down: Is it better to have the calculated field returned with the rest of the results or is it better to calculate it later when you need it?

Example:
I have a GridView that displays search results that has many fields like:

  • Application ID
  • Name
  • Account Type
  • Account Number

etc.

The account number field is not always consistently the same thing though. For accounts of type A they are eight digits long and for accounts of type B they are twelve.

After the search if they select a record and choose to continue the application I need to check the eigit digit account number for any access restrictions. All accounts of type A and B have an associated eigit digit account number, it is just that type B are the only ones to have the twelve digit number.

So should I add a redundant hidden field like “Common Account Number” to the search results and just hide it, thus making the heavily used search take slightly longer and making the results grid take up more space in the view state?

Or

Should I call the database when they try to continue the application and translate the Application ID into the eigit digit number so that I can use it to do my access restriction check? This will require one extra call to the database but the translation should be fast as both fields are in the same table and the application ID is a primary key. The continue application button will be used less as there are many other command options. People are also more accepting of waiting for something to process rather than waiting for search results.

  • 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-15T21:38:01+00:00Added an answer on May 15, 2026 at 9:38 pm

    You should always make your decision based on real measurements. I like your principle of making the most often used function as fast as possible.

    But maybe there’s a way of returning the right result set immediately — for example, do you need the 8-digit numbers in that display, or could you immediately return the 12-digit numbers for the type-B accounts? If yes, maybe you could define a view, or add a computed column right away in your data model. Is there another way of saving state, so that you could avoid hidden fields?

    Beyond that, you’re the one who can measure that and who has numbers. If the “continue” action is much rarer than the search, and if it doesn’t take long, well, by all means, add another database roundtrip. If however you’re able to get the search right in one step without adding measurable latency, go for that.

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

Sidebar

Related Questions

I have an app here that could be boiled down to uiscrollviews with images
I have boiled down an issue I'm seeing in one of my applications to
My question can be boiled down to, where does the string returned from stringstream.str().c_str()
I had a frustrating problem recently that boiled down to a very simple coding
This is a long text. Please bear with me. Boiled down, the question is:
I found a bug in my code which boiled down to comparing Double(0.0) with
I have a 'generic' boiler plate static method for checking for InvokeRequired and invoking
I have a very large javascript file I would like to load only if
There are four high level APIs to access Cassandra and I do not have
I have a setup with Client -> WCF -> POCO -> EF4. Say I

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.