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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:26:25+00:00 2026-05-11T05:26:25+00:00

Weird question, but I’m not sure if it’s anti-pattern or not. Say I have

  • 0

Weird question, but I’m not sure if it’s anti-pattern or not.

Say I have a web app that will be rendering 1000 records to an html table.

The typical approach I’ve seen is to send a query down to the database, translate the records in some way to some abstract state (be it an array, or a object, etc) and place the translated records into a collection that is then iterated over in the view.

As the number of records grows, this approach uses up more and more memory.

Why not send along with the query a callback that performs an operation on each of the translated rows as they are read from the database? This would mean that you don’t need to collect the data for further iteration in the view so the memory footprint shrinks, and you’re not iterating over the data twice.

There must be something implicitly wrong with this approach, because I rarely see it used anywhere. What’s wrong with this approach?

Thanks.

  • 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. 2026-05-11T05:26:25+00:00Added an answer on May 11, 2026 at 5:26 am

    Actually, this is exactly how a well-developed application should behave.

    There is nothing wrong with this approach, except that not all database interfaces allow you to do this easily.

    If we talk about tabularizing 10 records for a yet another social network, there is no need to mess with callbacks if you can get an array of hashes or whatever with a single call that is already implemented for you.

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

Sidebar

Related Questions

Sounds like a weird question, but say I have something like this: $.post( /myajax.php,
Weird question, but one that puzzles me a bit. In the old days when
Hi this may seem like a weird question, but here's my situation: I have
My question may seem a little weird but I am sure most of you
Maybe my question it's a little weird, but I'm trying to build a not-so-simple
Weird question but here it is. What are the programming concepts that were automated
Weird question, but I have a dictionary created with StringComparer.OrdinalIgnoreCase, looks something like this
Now if that isn't a weird question, I don't know what is. But here
Weird question I think its more of I am not sure what it is
Weird question but here goes... I have a webpage and i want to get

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.