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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:21:14+00:00 2026-05-22T15:21:14+00:00

I have a situation with my app. Suppose I have 6 users, each user

  • 0

I have a situation with my app.

Suppose I have 6 users, each user can have up to 9 score entries (i.e score 1000 points at 8:00pm with gold collected 3, silver 4 etc etc), say score per stage and 9 stages.

All these scores are being taken from an API call, so it can update with an interval of 3+minutes.

  • Operations I need to do on this data is
    • find the nearest min, max record from stage 4.
    • and some more operations like add or subtract two scores etc

All these 6 users, and their score records are already in database, being updated in needed after the API call.

Now my questions is :

Is this a better way for such kind of data (data of scores here) to keep all the data for all the 6 users in memory in NSArray or NSDictionary, and find min and max in that array by a min-max algorithm.

OR

It should be taken from Database by a query like ” WHERE score<=200 ” AND ” WHERE score >=200″, in short, 2 database queries which return nearest min and max record each, and not keeping all the data in memory.

What we are focusing on is speed, and memory usage both. The point is, Would a DB call be fast and efficient to find min and max OR a search for min,max in an Array of all the records from DB.
All records can be 6users * 9scores for each = 54.
Update time for records can be 3+ minutes.
Frequency of finding min max for certain values are high.

Please ask, if any more details are required.
Thanks in advance.

  • 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-22T15:21:15+00:00Added an answer on May 22, 2026 at 3:21 pm

    You’re working with such a small amount of data that I wouldn’t imagine it would be worth worrying about. Do whichever method makes your development process easiest!

    Edit:

    If I had a lot of data (hundreds of competitors) I’d use SQLite. You can do queries like the following:

    SELECT MIN(`score`) FROM `T_SCORE` WHERE `stage` = '4';
    

    That way you can let the database handle doing the calculation for you, so you never have to fetch all the results.

    My SQL-fu isn’t the most awesome, but I think you can also do this:

    SELECT `stage`, MIN(`score`) AS min, MAX(`score`) AS max FROM `T_SCORE` GROUP BY `stage`
    

    That would do all the calculations in one single query.

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

Sidebar

Related Questions

I have situation where a user can manipulate a large set of data (presented
Consider the following situation: - Suppose my app allows users to create the states
I have a situation where an app I'm writing works fine from the IDE
I have an interesting situation where I need to deploy an ASP.NET MVC app
This is the situation. I have a windows form app that uses an access
I have situation like this: user submits form with action='/pay' in '/pay' I have
Situation: I have an application that uses http connections extensively (stream ripping app) and
Despite similar question was asked , I have differnet situation: My app consists mostly
I have a situation with my MVC2 app where I have multiple pages that
I have the situation where a SolidColorBrush (defined in App.xaml) cannot be resolved during

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.