I have an application that essentially takes one list (submitted by the user) and returns a set of data for each item in the list. My primary issue is that I have a large Collection that I have stored in memory to avoid the cost of having to query the database each time but my queries are still taking nearly .5 seconds each and that is far too long.
The collection is US and CA postal codes and has nearly 1 Million records. The list from teh user is anywhere from a few dozen to a few thousand records and i need to do this for each so it gets very time consuming with large lists. Here is the query:
var resultList = PostalCodeList.Where(p => p.postalcode == userPostalCode).ToList();
The postal Code list has other relevant data as well (country, region, etc.) that needs to be returned to the user as well. 5 fields in all. All strings.
there is the possibility with the way the data is organized that there are 2 results for a given value, so i need to account for that.
Any ideas or suggestions would be great. Thanks!
Dictionaryto store the information (instead of a list).