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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:18:06+00:00 2026-05-13T22:18:06+00:00

I’ve a database consisting of about 1 million records. My application makes frequent incremental

  • 0

I’ve a database consisting of about 1 million records. My application makes frequent incremental search on these records and filters the UI list. The scenario is more like the ‘phone contact search’.
Currently i’m following this:

  1. Load the data into List<myModel> in the DataSource Layer`
  2. Send it to MainViewModel
  3. Load List<myModel> into ObservableCollection<myViewModel>
    (bound to ListView)
  4. According to the keyword, filter the `ObservableCollection
  5. While the application is being closed, update the database [Since the
    ObservableCollection may also be
    updated by the user]

My Questions:

  • Is this the efficient way?
  • Now my applicatation consumes around 30 to 50 MB of memory. Is that fair?
  • Or should i perform my search in the database instead? [but i cannot compromise on speed]
  • Should i always create a list of myModel and load it into my ObservableCollection?
  • Also advise me on the filtering technique that is much suited for incremental search(4th point). Currently I have a GenericList behind containing the entire collection for lookup and add the filtered items to the ObservableCollection, clearing all the previous items.

Edit: Previously i checked the memory consumption with only 37k records. With 250k records, the memory consumption is more than 100 MB:(. Hence now I’ve planned to keep only some 10k records in memory, If it goes beyond that I’ll query the db. Any suggestions?

Thanks in advance,
Veer

  • 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-13T22:18:07+00:00Added an answer on May 13, 2026 at 10:18 pm

    There are several things you can do without intterrupting the workflow of the user or taking a huge performance hit.

    Now my applicatation consumes around
    30 to 50 MB of memory. Is that fair?

    That’s normal for a .net application. You will notice the memory footprint directly after launching the application isn’t much smaller.

    Or should i perform my search in the
    database instead? [but i cannot
    compromise on speed]

    Querying the database repeatedly is only appropriate if you couldn’t load the data in one step in the first place. Whenever the user types into the box, you want to make sure you aren’t querying the database on each change to the search criteria but rather have a short timer in there, that waits for a second or so before querying the database with the new criteria. When requerying the database, it may also help to reduce the number of records shown via paging or lazy loading the rest of the data when the user starts scrolling. Proper database indexing will help you reduce the execution speed of such a query significantly.

    If you can however keep the whole list in memory (say it’s not too large to query it from the database in one step, or you need to show the whole list to the user anyway), it would be best to keep a pristine copy of the list and have a copy of that list that you can incrementally filter. Therefore you need to check if your search criteria is a subset of the previous search criteria. If so, you can filter the already-filtered list, else you need to filter the pristine list. This can be efficiently implemented using the LINQ .Where() operator, and if necessary parralelized using PLINQ. .Where() exhibits O(n) time AFAIK.

    This can be improved on by using a HashSet with appropriate key.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have a reasonable size flat file database of text documents mostly saved in
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.