We will modify the About
View
component with FirstName
and LastName
filter, using which we should have an index in the data store. If we analyse the data store, we don't have such an index in the following screenshot; it would be wise to create one for better performance:
Let's start working on improvising SQL query performance, and the starting point would be tracing the query using a SQL profiler. So, copy the translated SQL query of translated About
View
component LINQ query from the right-click the SQL Server Profiler, paste it in the SQL Query Analyzer
window, and select Trace Query in SQL Server Profiler
, highlighted as shown in the following screenshot:
Once the profiler is attached, execute the query in the Query Analyzer Window,
which should be displaying the following results, enable and see the actual execution plan as well:
The SQL profiler will capture anything that occurs in the database. Since we are querying the Person
entity, it is capturing all queries with respect...