Open SreemonPremkumarMuthukrishnan opened 2 months ago
This is unrelated to WPF, DataTable
and its oddities belong to https://github.com/dotnet/runtime
Looking at the "filter", I'm not that surprised tbh though. This is close to getting StackOverflowException
, x86 probably will.
See, that's the func you're gonna get stuck at. https://github.com/dotnet/runtime/blob/1337553ef2f1cb7a78bb1c19a85b8a9c929064b2/src/libraries/System.Data.Common/src/System/Data/Filter/BinaryNode.cs#L283
Hi,
Is there any way you know of to improve or optimize the performance of filtering in a DataTable? Specifically, I am looking for methods or best practices that can enhance efficiency and reduce the processing time for large datasets.
As @h3xds1nz said you need to be asking about these classes over at https://github.com/dotnet/runtime
Try IN operator instead. dataView.RowFilter = "[LastName] IN ('10002car', '10010car', '10021car')";
Description
When filtering the DataTable using the DefaultView.RowFilter property, it takes a long time (more than 2 minutes) to apply the filter. The number of items being filtered is 5,800. Please find the code snippet below.
Note: The filter string was provided along with the sample.
C# code:
Output reference:
https://github.com/user-attachments/assets/d4e746c9-d665-4c53-b3c0-76f6167296f9
Sample:
DataTable_Filtering_Demo.zip
Reproduction Steps
Expected behavior
The filter should not take too much time.
Actual behavior
The filtering takes too much time.
Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
No response
Other information
No response