DataTable search performance

  • Thread starter Thread starter Larry Smith
  • Start date Start date
L

Larry Smith

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.
 
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.
 
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.
 
Back
Top