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:
- Load the data into
List<myModel>
in the DataSource Layer`- Send it to MainViewModel
- Load
List<myModel>
intoObservableCollection<myViewModel>
(bound to ListView)- According to the keyword, filter the `ObservableCollection
- 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