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.
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.