This is a migrated thread and some comments may be shown as answers.

KendoUI Grid Filter operator startswith doesn't work with SQL index

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lee Ann
Top achievements
Rank 1
Lee Ann asked on 09 May 2014, 01:01 AM
I have 5M rows in a table and its string column Name is indexed. When I query using LIKE 'ABC%' in SQL Server, the index is used so the executing time is very fast (0s).
However when I use operator "Startswith" in KendoUI Grid to filter the results (along with EntityFramework: DataSourceResult result = entity.ToDataSourceResult(request)), the index in the table isn't used so the executing time is very slow (30s) and equals to the executing time when I use operator "Contains".
On the contrary, filter operator "Equals" works well with the index and returns results very fast (0s). Could you let me know why the operator "Startswith" doesn't work with index, and how could I solve this problem?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 12 May 2014, 03:51 PM
Hello Lee,

ToDataSourceResult uses the StartsWith string method which is translated to SQL query via EntityFramework. We are not sure what might create that performance issue (we rely on EF to do the work), I would suggest you to search the internet for similar issues.

http://stackoverflow.com/questions/13795155/ef-not-using-sql-index-when-filtering-with-startswith

Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Lee Ann
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or