What is the fastest alternative to Datatable.Select () to narrow cached data?

Stack Overflows:

I have a search function on my company’s website (based on .NET 2.0) that allows me to narrow my product catalog using up to 9 different fields. Right now, after you make your choice in the interface, I create a dynamic query and hit the database (SQL Server) to get the resulting list of item numbers.

I would like to move away from getting into the database every time and do it all in memory to get faster results. The main table is “3500 - 4500 rows” with 10 columns: position number (which may be the primary key) and 9 attribute fields (which repeat the values ​​for many rows). To get the necessary elements, there can be any number of different queries between 9 columns:

  • Column A = 'foo' And Column D = 'bar'
  • Column B = 'foo' And column C = 'bar' And column i = 'me'
  • Column H = 'foo'
  • etc...

Based on my research, the .Select () function seems to be the slowest way to do a search, but it seems to me that this is the fastest and easiest way to narrow your searches to get a list of position numbers:

MyDataSet.Select("Column B = 'foo' AND Column E = 'bar' AND Column I = 'me'")

, , , , , datatable.select()?

+3
2

Datatables , , , , , , .

, , , , . , , , , .

ADO.Net, ADO.Net DataTables. , , , , .

+2

- , : .

DataTables ( 3500-4500 ) - -. Select() DataTable DataTable - ( ), , 4000 , . , .

DataTables ( DataSets) ( Windows), .

+3

Source: https://habr.com/ru/post/1718672/


All Articles