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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:02:00+00:00 2026-05-15T17:02:00+00:00

There’s a little script that grabs a bunch of data from a database, and

  • 0

There’s a little script that grabs a bunch of data from a database, and does an iterative calculation. There are about 2500 rows used in this calculation, so it’s not a huge amount, but my boss wants me to partition the calculation anyways (as an exercise).

My general strategy (and I’m just shooting in the dark) is to hit the database, grab the first 50 rows, do each step in the calculation for those 50 rows, store the last row (as the calculation is iterative), grab the next 50 rows from the database and continue this process until all of the rows in the database have been accounted for.

Thoughts on my strategy? Any tips for doing this sort of thing?

  • 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-15T17:02:01+00:00Added an answer on May 15, 2026 at 5:02 pm

    One of the first things I learned in programming is that when you don’t know how to code something, first write out the process (algorithm) you’d use to solve it yourself, step-by-step, then see how to translate that to code.

    Sounds like a good first step for you would be to write out how you would solve the problem on paper–without worrying about partitioning. I know your problem isn’t this trivial, but I’m going to use an example of summation.

    To find the total of all the records, you would take record0 + record1 + record2 + … + record2499 = Sum.

    With that down, you can then go about seeing if it can be partitioned. For addition, that is easily done because addition is associative. Group up operations, and that’s one partition.

    Now, if you can’t find a way to partition the calculation manually, then it’s going to be difficult to try to partition it in code.

    But, my first step would be to work it out manually, then look for partition possibilities there.

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

Sidebar

Related Questions

There are many tutorials that talk about deleting index.php from the url. But I
There is a moment in my app, that I need to force to show
There is a column that exists in 2 tables. In table 1, this column
There's a Rails 3.2.3 web application which doesn't use any database. But in spite
There is a directed graph having a single designated node called root from which
There are two intents on the receiver side which are called from the same
There are nice SO question and answers about this issue, but these options didn't
There was a similar question posted asking in general about alternatives to Qt. Well,
There are a lot of blogs saying that a hasOwnProperty check should be used
There's a few previous questions on StackOverflow questioning how one goes about accessing local

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.