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

  • Home
  • SEARCH
  • 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 7885427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:04:04+00:00 2026-06-03T05:04:04+00:00

I have recently had several situations where I need different data from the same

  • 0

I have recently had several situations where I need different data from the same table. One example is where I would loop through each “delivery driver” and generate a printable PDF file for each customer they are to deliver to.

In this situation, I pulled all customers and stored them into

List<Customer> AllCustomersList = customers.GetAllCustomers();

As I looped through the delivery drivers, I’d do something like this:

List<Customer> DeliveryCustomers = AllCustomersList.Where(a => a.DeliveryDriverID == DriverID);

My question: Is the way I’m doing it by querying the List object faster than querying the database each time for customer records associated with the delivery driver?

  • 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-06-03T05:04:06+00:00Added an answer on June 3, 2026 at 5:04 am

    There isn’t an accurate number for amount of rows that if you pass it you should query the DB instead in in-memory List<T>

    But the rule of thumb is, DB are designed to work with large amount of data and they have optimization “mechanisms” while in in-memory there aren’t such things.

    So you will need to benchmark it to see if the round-trip to DB is worth it for that amount of rows for each time it’s important to you

    “We should forget about small efficiencies, say about 97% of the time: premature
    optimization is the root of all evil
    “

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

Sidebar

Related Questions

I have recently upgraded from websphere 5.1.2 to websphere 6.1 server. I had some
I have designed several animated Panel s in C# that all inherit from one
I have had several occasions recently to access a specific class several times over
We have a C++ library that we provide to several different clients. Recently we
I have run into several instances recently where I have had trouble figuring which
I have recently had alot of suggestions on my website, and one of them
Using PHP / MySQL all encoded up as UTF, we have recently had to
So far I have been creating Web Portal but recently I had a request
I have recently upgraded my ASP.NET MVC application from beta to version 1. And
I have recently stumbled upon a problem with selecting relationship details from a 1

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.