Well for the test, the select performs an inner join on two simple tables
that have no indexes. The tables have ints and bigints and the result set
obviously won't have any indexes as it will be tempdb w/ about 100K rows.
When I step in the debugger the data retrieval from sql server is pretty fast
- around 1 - 2 sec for both the DataTable and a custom list. BUT, when I step
over the code that sets the datasource, the DataTable does the extra work.
The call stack during the extra work is something like:
IListSource.GetList
dataTable.DefaultView
defaultView.SetIndex2 <- this can't be indexing on any specific column?
UpdateIndex
GetIndex
Index.ctor
InitRecords
RBtree<>.Insert
RBTree<>.Left/Right/Parent <- called 100's of millions of
times?
The RBTree methods are called 100's of millions of times while this index is
set. I really don't want any indexes because I want the user to be able to
sort/group/filter by any combination of columns. I was wondering if there was
a way to give the DataTable some extra knowledge so that the list inside of
DataRowCollection is maintained more efficiently.
thanks,
Paul.
[quoted text, click to view] "Miha Markic" wrote:
> How does your table look like?
> Did you try pre-create the table without any key?
>