Bug #64935 | LINQ to SQL's StartsWith() and Contains() generate slow LOCATE() instead of LIKE | ||
---|---|---|---|
Submitted: | 10 Apr 2012 22:53 | Modified: | 19 Jul 2012 23:02 |
Reporter: | Alex K. | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 6.5.4 | OS: | Windows (7 x64) |
Assigned to: | Fernando Gonzalez.Sanchez | CPU Architecture: | Any |
Tags: | .net, connector, linq, string, wildcard |
[10 Apr 2012 22:53]
Alex K.
[19 Jul 2012 23:02]
John Russell
Added to changelog for 6.5.5: The LINQ to SQL data provider for MySQL was generating inefficient code for the StartsWith() and Contains() methods, calling the MySQL LOCATE() function rather than using a LIKE operator with a % wildcard. The fix causes both methods to use the LIKE syntax, although only StartsWith() gains a substantial performance improvement. Queries involving the StartsWith() method can now take advantage of an index on the corresponding column.
[17 Mar 2014 10:46]
Carl Partridge
I believe that there has been a regression here, this seems to be a problem when using Connector/Net 6.8.3; should I file a new bug or can this be re-opened?
[17 Mar 2014 11:04]
Carl Partridge
I have filed a new bug report here: http://bugs.mysql.com/bug.php?id=72058