After creating this index, the number of logical reads has shrunk to 60 and represents a 99%
improvement in this query.
Getting it right the first time
Before utilizing the SQL diagramming technique, I would tend to focus on the execution plan and attempt to reduce the cost of expensive steps in the plan. Based on the initial execution plan for this query, I would have focused on the REGISTRATION table and most likely added an index on the signup_date and cancelled columns, which by the way is what the Missing Index DMV in SQL Server suggested as well. There would have been an improvement in logical reads by approaching the problem this way too. Logical Reads would have been reduced from 9,634 to 620 by creating the index mentioned above and the query would probably have executed well enough for the customer. However, as we have seen, SQL Server would have been required to read through more than four times the number of rows to get the same results and the number of logical reads would still have been 10 times higher. SQL diagramming helped me to get it right the first time.
After creating this index, the number of logical reads has shrunk to 60 and represents a 99%
improvement in this query.
Getting it right the first time
Before utilizing the SQL diagramming technique, I would tend to focus on the execution plan and attempt to reduce the cost of expensive steps in the plan. Based on the initial execution plan for this query, I would have focused on the REGISTRATION table and most likely added an index on the signup_date and cancelled columns, which by the way is what the Missing Index DMV in SQL Server suggested as well. There would have been an improvement in logical reads by approaching the problem this way too. Logical Reads would have been reduced from 9,634 to 620 by creating the index mentioned above and the query would probably have executed well enough for the customer. However, as we have seen, SQL Server would have been required to read through more than four times the number of rows to get the same results and the number of logical reads would still have been 10 times higher. SQL diagramming helped me to get it right the first time.
การแปล กรุณารอสักครู่..
