PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET DataTable search performance

Reply

DataTable search performance

 
Thread Tools Rate Thread
Old 03-01-2007, 03:50 PM   #1
Larry Smith
Guest
 
Posts: n/a
Default DataTable search performance


Hi there,

Can anyone comment on the performance issues of "DataTable.Select()" vs
"DataView.Find()" (or "DataView.FindRows()"). I have to conduct repeated
searches using the same index and I'm not sure which to rely on. From what
I've read, "DataTable.Select()" doesn't rely on indexes so using a
"DataView" would seem to be the obvious choice. However, that still
requires the index be built each time I construct a new "DataView". Given
that I already have a "UniqueConstraint" established on the multiple columns
I need to search on, can anyone confirm whether this constraint actually
results in a pre-built index behind the scenes. If so then I would think
that "DataTable.Select()" would rely on this existing index after parsing
the filter expression I pass to it. Can someone comment on this situation in
general. Thanks very much.


  Reply With Quote
Old 03-01-2007, 07:05 PM   #2
Ignacio Machin \( .NET/ C# MVP \)
Guest
 
Posts: n/a
Default Re: DataTable search performance

Hi

Why don't you simply try it in your environment, run the same search with
each variant and keep a track of how much time each version takes.


--
Ignacio Machin
machin AT laceupsolutions com

"Larry Smith" <no_spam@_nospam.com> wrote in message
news:uZ30r70LHHA.4708@TK2MSFTNGP02.phx.gbl...
> Hi there,
>
> Can anyone comment on the performance issues of "DataTable.Select()" vs
> "DataView.Find()" (or "DataView.FindRows()"). I have to conduct repeated
> searches using the same index and I'm not sure which to rely on. From what
> I've read, "DataTable.Select()" doesn't rely on indexes so using a
> "DataView" would seem to be the obvious choice. However, that still
> requires the index be built each time I construct a new "DataView". Given
> that I already have a "UniqueConstraint" established on the multiple
> columns I need to search on, can anyone confirm whether this constraint
> actually results in a pre-built index behind the scenes. If so then I
> would think that "DataTable.Select()" would rely on this existing index
> after parsing the filter expression I pass to it. Can someone comment on
> this situation in general. Thanks very much.
>



  Reply With Quote
Old 03-01-2007, 07:30 PM   #3
Larry Smith
Guest
 
Posts: n/a
Default Re: DataTable search performance

> Why don't you simply try it in your environment, run the same search with
> each variant and keep a track of how much time each version takes.


It's unreliable in the general case. Maybe one method works better depending
on various factors but not others. I'm trying to pin down what these factors
are for future use as well. Thanks though.


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off