DataView Rowfilter Speed
From: Joseph (_at_discussions.microsoft.com)
Date: 11/10/04
- Next message: Steve Hoberecht [Microsoft]: "RE: ADo XML"
- Previous message: Peter Afonin: "Re: -2147217887 [Microsoft][ODBC SQL Server Driver]Optional feature n"
- Next in thread: Joseph: "RE: DataView Rowfilter Speed"
- Reply: Joseph: "RE: DataView Rowfilter Speed"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Nov 2004 14:13:07 -0800
My application allows the end user to enter search criteria to limit the
information displayed in a datagrid. The code executes a stored procedure
and populates a dataset with a single table.
A dataView is created from that table which is bound to the data grid. For
example:
'Run the stored procedure and return data set.
DVEds = objDVE.GetPrimaryDataView(StoredProcedure)
'Create a data view from the data set
DVEdv = New DataView(DVEds.Tables(0))
DVEdv.AllowDelete = False
DVEdv.AllowEdit = False
DVEdv.AllowNew = False
'Bind the grid to the data view
grdMainView.DataSource = DVEdv
So far - so good. A user can then select a field from a list and enter some
search criteria. The criteria is transformed into an SQL statement and the
rowfilter is updated:
Dim intFieldType As Integer
intFieldType = Me.DVEds.Tables(0).Rows(0)(Me.cmbSearchField.Text).gettypecode
strRowFilter = BuildSQL(cmbSearchField.Text, intFieldType, txtSearch.Text)
Me.DVEdv.RowFilter = strRowFilter
No problem - this all works fine. It takes some time to populate the
initial dataset, but then the row filter works well enough.
I'm looking about 70,000 records. The problem occurs after entering several
searches. For example,
FirstName="Mike" (takes 2 seconds)
FirstName="Fred" (takes 2 seconds)
Firstname="Mike" (takes 2 m-i-n-u-t-e-s)
I've simplified this for this request but the basic problem is that some
rowfilter searches are resolved quickly, and some take minutes and there is
no pattern with regard to whether the search returns a large or small number
of records, or whether the search is higher or lower or how the data is
sorted. Sometimes, I can execute 10 searches with no problems, and then, a 2
minute delay.
I realize the rowfilter is rebuilding the index - and that filtering would
be faster through the stored procedure - but I'd like to know the dymamics of
what make the rowfilter work - and what consideration I can give to making it
perform consistantly.
Thanks!
- Next message: Steve Hoberecht [Microsoft]: "RE: ADo XML"
- Previous message: Peter Afonin: "Re: -2147217887 [Microsoft][ODBC SQL Server Driver]Optional feature n"
- Next in thread: Joseph: "RE: DataView Rowfilter Speed"
- Reply: Joseph: "RE: DataView Rowfilter Speed"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|