[Mono-bugs] [Bug 77691][Maj] New - DataTable.Select is linear and causes memory to explode

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Mar 2 17:12:32 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by prensing at cimetrics.com.

http://bugzilla.ximian.com/show_bug.cgi?id=77691

--- shadow/77691	2006-03-02 17:12:32.000000000 -0500
+++ shadow/77691.tmp.18907	2006-03-02 17:12:32.000000000 -0500
@@ -0,0 +1,55 @@
+Bug#: 77691
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Fedora Core 4
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Sys.Data
+AssignedTo: tsenganal at novell.com                            
+ReportedBy: prensing at cimetrics.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataTable.Select is linear and causes memory to explode
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I was having serious speed problems with some code: it was really slow and
+memory usage was growing continuously. I traced the problem to
+DataTable.Select().
+
+If I use DataTable.Select( filter ), Mono will create an Index object and
+cache that. That sounds OK until you look closely and realize that Index
+includes the "filter", not just the set of columns. This means that the
+cached Indexes are really cached Queries, not indices on a set of columns.
+
+The attached program demonstrates the problem. I fill a table with N
+integers and then run "Select( "A = i" )" for all values i. The time used
+to run the program is order N^2 (one N for the number of searchs, and one N
+because each search is linear). Memory grows dramatically because of all
+those cached Index objects (which will never get used again).
+
+Steps to reproduce the problem:
+1. Compile my program and run:
+     dataTableTest.exe 1000
+2. You will see that significant memory is in use after the Selects.
+3. 
+
+Actual Results:
+Effectively, every Select() is a linear search and causes memory to be
+permanently used.
+
+Expected Results:
+A true index of the columns, without any filter applied, should be built
+and cached. Then, subsequent Select() calls based on the same columns would
+be much faster with no additional memory.
+
+How often does this happen? 
+Always.
+
+Additional Information:


More information about the mono-bugs mailing list