How to return a large number of records that match on a key fast using OLEDB?
I am approaching a large (~1000,000 records) table using OLEDB. Currently, I run a single query returning the entire table.
To speed up the loading, I am considering to first determine (in c#) the key of the records that I need , and then only return those records. The keys can only be determined in c#.
开发者_Python百科I expect that I only need 10,000-100,000 records, each with a different key. I can return each of those records by using the following query via OLEDB:
"Select field1,field2,...,fieldn from table where key1 = " + key1[i] + " and key2 = " +key2[i]
Is this the fastest method? And considering that I need to retrieve 1-10% of all records in this way, is it perhaps faster to just retrieve the entire table and skip over the data that I need?
精彩评论