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

problem with indices

1 Answer 9 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Vitaliy
Top achievements
Rank 1
Vitaliy asked on 10 Oct 2014, 02:15 PM
Hello

We use Telerik Grid (in ASP.NET AJAX).
It's convinient to use Column Grid Filters because it let us avoid lot's routine job.
But the bad size is that it used to generate such kind of quieries to our SQL Server:

SELECT *
FROM   [dbo].[OPCatalogue] AS [t0]
WHERE  (CONVERT(NVarChar(MAX), (CASE
                                  WHEN 0 = 1 THEN CONVERT(NVarChar(40), '')
                                  ELSE CONVERT(NVarChar(40), [t0].[SKU])
                                END))) LIKE 'something%' 

This query works without using indecies, so it would be much more prefer to construct the sql like this:
SELECT *
FROM   [dbo].[OPCatalogue] AS [t0]
WHERE  [t0].SKU LIKE 'something%'

this way it's going to use the index and work much faster.

How can we make Telerik Grid generate such kind of simpler queries?

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 15 Oct 2014, 02:52 PM
Hello,

You can handle ItemCommand event (check that e.CommandName is "FilterCommandName") where you can prevent the initial filtering and build a simpler queries:
http://www.telerik.com/help/aspnet-ajax/grid-operate-with-filter-expression-manually.html

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Filter
Asked by
Vitaliy
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or