Is it possible to access a row in a datatable in constant time?
-
Is there a way to configure\create a datatable (strongly typed or untyped) that can have a row accessed in constant time if you are searching on the primary key? If there isn't a way, then what is the quickest way to access a row when using datatables? Thanks, Ryan
"I'm a mushroom cloud layin motherf*cker, motherf*cker!" - Marsellus Wallace from Pulp Fiction
-
Is there a way to configure\create a datatable (strongly typed or untyped) that can have a row accessed in constant time if you are searching on the primary key? If there isn't a way, then what is the quickest way to access a row when using datatables? Thanks, Ryan
"I'm a mushroom cloud layin motherf*cker, motherf*cker!" - Marsellus Wallace from Pulp Fiction
Ryan Andrus wrote:
have a row accessed in constant time
What is "constant time"? Additional: To the person that voted this a 1. Why is this not a valid question? When I read the OP's request I wondered if he meant "real time" or something else. So I asked for clarification. What is so wrong with that?! -- modified at 19:49 Tuesday 26th June, 2007
Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... * Reading: Developer Day 5 Ready to Give up - Your help will be much appreciated. My website
-
Ryan Andrus wrote:
have a row accessed in constant time
What is "constant time"? Additional: To the person that voted this a 1. Why is this not a valid question? When I read the OP's request I wondered if he meant "real time" or something else. So I asked for clarification. What is so wrong with that?! -- modified at 19:49 Tuesday 26th June, 2007
Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... * Reading: Developer Day 5 Ready to Give up - Your help will be much appreciated. My website
O(1) in Big O notation which basically means that the amount of time to find one row in the datatable is independent of the number of rows. In other words, it will always take the same amount of time to access a row in the datatable. The same way that getting an element in an array in C++ is constant time because it is done through pointer arithmetic and not by iterating through the elements.
"I'm a mushroom cloud layin motherf*cker, motherf*cker!" - Marsellus Wallace from Pulp Fiction
-
O(1) in Big O notation which basically means that the amount of time to find one row in the datatable is independent of the number of rows. In other words, it will always take the same amount of time to access a row in the datatable. The same way that getting an element in an array in C++ is constant time because it is done through pointer arithmetic and not by iterating through the elements.
"I'm a mushroom cloud layin motherf*cker, motherf*cker!" - Marsellus Wallace from Pulp Fiction
Please have a look at Indexes and Clusters. I think it will reduce the time from O(n) to O(log n).
Regards, Arun Kumar.A
-
Please have a look at Indexes and Clusters. I think it will reduce the time from O(n) to O(log n).
Regards, Arun Kumar.A
Are you refering to index's on the Database table? That is not what I am asking about. I am talking about System.Data.DataTable. If there is a way to index a System.Data.DataTable can someone please post up a how to?
"I'm a mushroom cloud layin motherf*cker, motherf*cker!" - Marsellus Wallace from Pulp Fiction
-
Please have a look at Indexes and Clusters. I think it will reduce the time from O(n) to O(log n).
Regards, Arun Kumar.A
I am asking about System.Data.DataTable not a table in the database. Do System.Data.DataTable's support index's?
"I'm a mushroom cloud layin motherf*cker, motherf*cker!" - Marsellus Wallace from Pulp Fiction