<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7665562022538976949</id><updated>2024-09-09T00:18:04.123-07:00</updated><title type='text'>SQL Foundation</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rajnish-awasthi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7665562022538976949/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rajnish-awasthi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rajnish Awasthi</name><uri>http://www.blogger.com/profile/16093624315107523775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkqQ3jydiVRLCI1vgVAv1-FLTTYnSHmzw8tVC_-909qHEkybYbVKG5nKFHUof22a5DJcvoO1gr9IzJDUFIulfEvj3eCxkrzH4s5EDDfdX0RMPcACLRp67jZ-eR470z/s220/rajnish.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7665562022538976949.post-3850451613243579595</id><published>2011-10-27T04:45:00.000-07:00</published><updated>2011-11-01T09:30:51.777-07:00</updated><title type='text'>T-SQL Performance Tuning</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Good Evening ,&lt;br /&gt;
&lt;br /&gt;
We had discussed basic incidence when query can be optimize by adding cluster/ non cluster index and &amp;nbsp;modification in select columns instead of using &quot;*&quot;.&lt;br /&gt;
&lt;br /&gt;
Get more detail by click on&amp;nbsp;&lt;a href=&quot;http://rajnish-awasthi.blogspot.com/2011/10/sql-query-running-slow.html&quot;&gt;http://rajnish-awasthi.blogspot.com/2011/10/sql-query-running-slow.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Here I would really like share other important resources which can be used to analyze query and actually helps to get the exact reason of slow running query.&lt;br /&gt;
&lt;br /&gt;
We are going here to discuss the following key items.&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;ul&gt;&lt;li&gt;Execution plan.&lt;/li&gt;
&lt;li&gt;DMVs/DMFs.&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;u style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;u style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Execution Plan &lt;/span&gt;&lt;/u&gt;&amp;nbsp; If query is running slow then definitely few reasons can be behind it, so the question is that how to find those reasons. It is difficult but not impossible to get the exact reason of slow running query, when query get executed it uses/create execution plan which can be used further to run the same query. If optimizer does not find the reusable execution plan then it create new one and it stores in sql cache .&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcSQhRClG_fV0No4s5rnPKJAdtdACm4CKZf70w_rS0pG3LHpwogNiLtP6fZBgW4PzRuoMM_LkgCDg4P3MAgTGMfvFpNLkYaN4jgJHYg3lBJIBWJYhS5oiI6WiGg9dDXC198NOE9rY8kG4/s1600/ExecPlan.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;107px&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcSQhRClG_fV0No4s5rnPKJAdtdACm4CKZf70w_rS0pG3LHpwogNiLtP6fZBgW4PzRuoMM_LkgCDg4P3MAgTGMfvFpNLkYaN4jgJHYg3lBJIBWJYhS5oiI6WiGg9dDXC198NOE9rY8kG4/s320/ExecPlan.JPG&quot; width=&quot;320px&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Execution Plan&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp;In figure, we can see 100% cost on cluster index scan.Because this is basic execution plan, if we&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; consider&amp;nbsp;complex query then easily &amp;nbsp;complex execution plan can be seen over the screen. We are seeing&amp;nbsp;cluster&amp;nbsp;index scan because there is no index in table we is covering whole query that is why scan is being&amp;nbsp;used&amp;nbsp; here. Lets see what happen when following query is executed.&lt;/div&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f4cccc;&quot;&gt;&amp;nbsp; &amp;nbsp;select * from &amp;nbsp;HumanResources.Employee where employeeid between 10 and 50&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyvIJFXdp75gQfxRdcGRl-HgmhbDsjWEybSkXROycr2VA3UyAnr-7TvBWW6klg8Khc2YqBP5d2XqFv37H3JTu21NjMq1aHogpF6Ba853W4BGa8f1GwveK4CZFYShbEkCzuFeLwZAP9Na0/s1600/ExecPlan_1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;66px&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyvIJFXdp75gQfxRdcGRl-HgmhbDsjWEybSkXROycr2VA3UyAnr-7TvBWW6klg8Khc2YqBP5d2XqFv37H3JTu21NjMq1aHogpF6Ba853W4BGa8f1GwveK4CZFYShbEkCzuFeLwZAP9Na0/s320/ExecPlan_1.JPG&quot; width=&quot;320px&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Hmm, because filter has added here so now cluster scan has been replaced with cluster seek and cluster&amp;nbsp;index now can cover whole query so it can execute faster than before. This way we have analyzed the query&amp;nbsp;and resolved the issue by adding where clause in select statement.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
When talking execution plan, DBA should caught first those&amp;nbsp;queries which are taking&amp;nbsp;high cost. When analyzing SP&#39;s execution plan, it could be difficult to find the worst part because plan does not gives the time duration for each query used in stored procedure. Some time print getdate() can be used in sp between sql statement to get the time duration which is taken by each query in stored procedure, this way developer/DBA can caught the worst query in the term of taking more time, special attention should given here for long running queries and again DBA should analyze execution plan for these queries.&lt;br /&gt;
&lt;br /&gt;
Okay, now the question comes that what could be focus pints when analyzing execution plan ?&lt;br /&gt;
&lt;br /&gt;
We are talking about graphical execution plan&amp;nbsp;in our discussion&amp;nbsp;however execution plan could be in form of text and XML as well. When interpreting graphical execution plan usually read it from &lt;em&gt;right to left&lt;/em&gt; and &lt;em&gt;top to bottom.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Here we can think about following key items which can included when analyzing execution plan of worst quires, you can leave items&amp;nbsp;i.e. cluster index seek, non cluster index seek in execution plan because &#39;seek&#39; keyword itself gives the best performance while executing query.&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Table scan&lt;/li&gt;
&lt;li&gt;Cluster index scan&lt;/li&gt;
&lt;li&gt;Non cluster index scan&lt;/li&gt;
&lt;li&gt;Rid lookup&lt;/li&gt;
&lt;li&gt;Key lookup&lt;/li&gt;
&lt;li&gt;Hash match&lt;/li&gt;
&lt;li&gt;Merge join&lt;/li&gt;
&lt;li&gt;Sort&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;u&gt;Table Scan&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Table scan is the worst part if you are getting this in your execution plan, DBA would be happy when tuning such queries because definitely query performance will increase if he do even little changes. Probably table scan occurs due to missing of&amp;nbsp; indexes. Also you may get surprise when query optimizer can select table scan instead of indexes which may already exist on table, why it happen !,&amp;nbsp; because table has not much records which should be there for choosing any index instead of table scan as optimizer think that table scan could be faster than using index for small size of tables.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Cluster Index Scan&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Cluster scan is almost the same as table scan, optimizer finds more rows are returning than actual result, so how to resolve such issue ? &lt;br /&gt;
Developer should think about the columns he had mentioned in select statement and rows return by the query, optimizer is going to return the rows more than expectation so rows can be filter by adding appropriate where clause and unnecessary column should eliminate from select statement.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #f4cccc;&quot;&gt;﻿﻿﻿&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; emp &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;WHERE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; fname &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39;Jeannie2&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
﻿﻿&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG2XCuGaU4fvHDK4XYfjhMJdb-sGc6QNlLvyw7qFYuCy7IRugHF-kRMoXCtZKv6kyKi0O9fk851LidbuZuZXzYkS59JARnI5MjQmDsD15ywp-_xIzdkl_ZDb0_y07a7akKO6w_QLVdUfM/s1600/SQLPic.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;77px&quot; ida=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG2XCuGaU4fvHDK4XYfjhMJdb-sGc6QNlLvyw7qFYuCy7IRugHF-kRMoXCtZKv6kyKi0O9fk851LidbuZuZXzYkS59JARnI5MjQmDsD15ywp-_xIzdkl_ZDb0_y07a7akKO6w_QLVdUfM/s320/SQLPic.JPG&quot; width=&quot;320px&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Cluster index scan&lt;br /&gt;
&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;﻿﻿﻿﻿﻿ Because there is no another non cluster index on fname so optimizer used only cluster index and cluster index scan is being used here because index does not cover whole query ﻿, below select statement and its execution plan gives the idea that if key column is the part of where clause then optimizer can use the index and whole query would use the cluster index seek.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #f4cccc;&quot;&gt;SELECT &lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black; font-size: x-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: x-small;&quot;&gt; emp &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;WHERE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; id &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 167396&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;﻿&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidJCHLRmx1dLAetyP-tQztHsP_hMA2pDheFJKUIDdWLjbK8_3bwOPiY3zrX-3c4SLblJOaNowRiB6aexKHWK6m4strP-fEOpDfIeFNqUZRx7hxG0SY9zMKLOH8h3tFbWbfwgARCI-Txgc/s1600/SQLPic.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;103px&quot; ida=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidJCHLRmx1dLAetyP-tQztHsP_hMA2pDheFJKUIDdWLjbK8_3bwOPiY3zrX-3c4SLblJOaNowRiB6aexKHWK6m4strP-fEOpDfIeFNqUZRx7hxG0SY9zMKLOH8h3tFbWbfwgARCI-Txgc/s320/SQLPic.JPG&quot; width=&quot;320px&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Cluster index seek&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;strong&gt;&lt;u&gt;Non Cluster Index Scan&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Non cluster index scan is also same as cluster index scan. Whenever another index is required by query optimizer, it creates an entry into DMVs and also append useful information into columns which is really useful when DBA/Developer is analyzing the worst query part. Non cluster index scan occurs because of the same reason as index does not cover&amp;nbsp;whole query&amp;nbsp;and need another piece of data that can retrieved from outside and that is why index scan occurs. &lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Index scan can be resolved by adding another filter which returns less data and can retrieve data from non cluster index only, unnecessary rows retrieval can hurt the sql performance.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;strong&gt;&lt;u&gt;Rid Lookup&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;
lookup as well.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;lookup comes in picture.&lt;/div&gt;﻿ &lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbC6XbXRoUMwjRNKM0HipMPDhyphenhyphen8bRkF2vF8Dadh3DKGC2x4DADs9K6XY1skGAMyJU4YnFjbHioqUfogH8L7pO60kecjeb4UTCsY-b96aJ9GkZzFxG0z1KJoWuIxO6qdDMH48LyiEjMWQ0/s1600/SQLPic.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;135px&quot; ida=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbC6XbXRoUMwjRNKM0HipMPDhyphenhyphen8bRkF2vF8Dadh3DKGC2x4DADs9K6XY1skGAMyJU4YnFjbHioqUfogH8L7pO60kecjeb4UTCsY-b96aJ9GkZzFxG0z1KJoWuIxO6qdDMH48LyiEjMWQ0/s320/SQLPic.JPG&quot; width=&quot;320px&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;RID Lookup&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;﻿ &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;strong&gt;&lt;u&gt;Key Lookup&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;There is another lookuplookup except few differences.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;lookup as bookmark and by using nested loop data join is required to combine the rows of index seek and key lookup. In such scenario non cluster can be modified by adding column to cover the whole query.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq7Vb59h9lyFJ-OE5zOxQ1yqTEGDPX5KZ3KPZEMewpn7hOY4x7cN2QCYZankLNCf-K1LCtNjRAJ-e9_UFI_wFZmMH1svupTl80cqML1N9nvTbHq1ltUOsZv_R7jpYZJswPFLrFGXN07Ek/s1600/SQLPic.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;106px&quot; ida=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq7Vb59h9lyFJ-OE5zOxQ1yqTEGDPX5KZ3KPZEMewpn7hOY4x7cN2QCYZankLNCf-K1LCtNjRAJ-e9_UFI_wFZmMH1svupTl80cqML1N9nvTbHq1ltUOsZv_R7jpYZJswPFLrFGXN07Ek/s320/SQLPic.JPG&quot; width=&quot;320px&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Key Lookup&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div align=&quot;left&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;strong&gt;&lt;u&gt;Hash Match&lt;/u&gt;&lt;/strong&gt;﻿&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;When we are talking about data fetched from multiple table by using joins then&amp;nbsp;situation may come that your query can use hash match internally which gives an idea to &lt;em&gt;change in sql query or any missing index or modification required in existing index&lt;/em&gt;&amp;nbsp;can be on table otherwise optimizer can continue with hash match because it is only the way to fetch the data faster from hash table.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;Merge Join&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Whenever data is puling from multiple tables and joined columns are &amp;nbsp;presorted, query optimizer choose merge join as a most efficient method to get the data from multiple tables, if columns are not presorted then query performance could be degrade because sort operation would be chosen by optimizer before merge join.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifXJS61zu9hvDE6cW2DRv-CVogHFcP46XeAgTpWb-pBaZaaMTRfJZre74CU6c1UMVnu1K9_7LHsVPTKmuz5BmfhzxDoDk6n82KM9nGVDZvf7WuufAVgAmAPirj9juoXdjjpsdPB-YuZQg/s1600/ExecPlan_2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;97&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifXJS61zu9hvDE6cW2DRv-CVogHFcP46XeAgTpWb-pBaZaaMTRfJZre74CU6c1UMVnu1K9_7LHsVPTKmuz5BmfhzxDoDk6n82KM9nGVDZvf7WuufAVgAmAPirj9juoXdjjpsdPB-YuZQg/s320/ExecPlan_2.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;Sort&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;As operator is self-explanatory, when sort operation takes more than 50% cost in a query it means that query can be optimized by few changes in sql code otherwise data can be presorted by using index on column which is being used in order by clause. Some time when where clause is missing in select statement, it can lead sort operation.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;/div&gt;&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Dynamic Management View / Function&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
DMVs/DMFs are new feature of &amp;nbsp;SQL Server 2005, well I think its a great feature and gift for DBAs, now administrator can easily maintain various important task by using of DMVs/DMFs. If we talk about sql 2000, first thing comes in DBA&#39;s mind that whats necessary DBCC statement are in sql server and how to use those &amp;nbsp;DBCC statement to produce necessary reports for management, various decision making report for DBAs, etc.&lt;br /&gt;
&lt;br /&gt;
Many views and functions are included with sql 2005, following list of&amp;nbsp;DMV/DMF&amp;nbsp;can be useful for various purpose.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;u&gt;sys.dm_db_index_usage_stat&amp;nbsp;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
Gives the count for index scan, seek, lookup. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;i&gt;&lt;u&gt;sys.dm_db_index_operational_stats &lt;/u&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;br /&gt;
Gives a deeper idea about index used, leaf insert , leaf update, etc.&lt;br /&gt;
&lt;i&gt;&lt;u&gt;sys.dm_db_index_physical_stats&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
It is substitute of DBCC SHOWCONTIG, it returns fragmentation of data and indexes and takes&amp;nbsp;few parameter as it is DMF.&lt;br /&gt;
&lt;i&gt;&lt;u&gt;sys.dm_db_missing_index_groups&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
Returns detail about what missing indexes are contains in specific missing group.&lt;br /&gt;
&lt;i&gt;&lt;u&gt;sys.dm_db_missing_index_group_stats&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
Returns information about group of missing indexes i.e. user_seek, user_scan, last_user_seek, etc.&lt;br /&gt;
&lt;u&gt;&lt;i&gt;sys.dm_db_missing_index_details&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
Returns missing index detail i.e. equality column, inequality column, included column, etc.&lt;br /&gt;
&lt;u&gt;&lt;i&gt;sys.dm_exec_connections&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
Returns detail about connection established to sql instance i.e. session id, connection time, protocol type, &amp;nbsp;last read, last write, connection id, etc.&lt;br /&gt;
&lt;u&gt;&lt;i&gt;sys.dm_exec_sessions&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
Returns useful information about all user active connection i.e. session id, login name, host name, login time, status, cpu time, memory usage, etc.&lt;br /&gt;
&lt;u&gt;&lt;i&gt;sys.dm_exec_requests&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Returns detail about each request which is executing within sql server i.e. session id, start time, status, command, database id, connection id, blocked session id, wait type, read, write, etc.&lt;/span&gt;&lt;br /&gt;
&lt;u&gt;&lt;i&gt;sys.dm_io_virtual_file_stats&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Returns I/O statistics for data and log files.&lt;/span&gt;&lt;br /&gt;
&lt;u&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;sys.dm_os_wait_stats&lt;/span&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Returns information about the waits encountered by threads that executed i.e. wait type, waiting task count, wait time ms, max wait time ms&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rajnish-awasthi.blogspot.com/feeds/3850451613243579595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajnish-awasthi.blogspot.com/2011/10/t-sql-performance-tuning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7665562022538976949/posts/default/3850451613243579595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7665562022538976949/posts/default/3850451613243579595'/><link rel='alternate' type='text/html' href='http://rajnish-awasthi.blogspot.com/2011/10/t-sql-performance-tuning.html' title='T-SQL Performance Tuning'/><author><name>Rajnish Awasthi</name><uri>http://www.blogger.com/profile/16093624315107523775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkqQ3jydiVRLCI1vgVAv1-FLTTYnSHmzw8tVC_-909qHEkybYbVKG5nKFHUof22a5DJcvoO1gr9IzJDUFIulfEvj3eCxkrzH4s5EDDfdX0RMPcACLRp67jZ-eR470z/s220/rajnish.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcSQhRClG_fV0No4s5rnPKJAdtdACm4CKZf70w_rS0pG3LHpwogNiLtP6fZBgW4PzRuoMM_LkgCDg4P3MAgTGMfvFpNLkYaN4jgJHYg3lBJIBWJYhS5oiI6WiGg9dDXC198NOE9rY8kG4/s72-c/ExecPlan.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7665562022538976949.post-5754150500416043967</id><published>2011-10-25T21:21:00.000-07:00</published><updated>2011-10-26T21:09:58.782-07:00</updated><title type='text'>SQL Query Running Slow !</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Most of the time&amp;nbsp;beginners&amp;nbsp;sql developer&amp;nbsp;&amp;nbsp;comes with query performance issue&amp;nbsp;it could be&amp;nbsp;that&amp;nbsp;one of report having SQL query is running slow even earlier it was running fine. I have faced this issue several time, my observation have included the following points which degrade query performance.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;u&gt;&lt;strong&gt;Select * from &amp;lt;Table Name&amp;gt;&amp;nbsp;&lt;/strong&gt;&lt;/u&gt;&amp;nbsp; Here * is commonly used by new developers and they really get surprised when they see query taking more time and do the complaint with DBA and says &quot;simple query I have written is taking unexpected time&quot; :-).&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;So friends specially developers who are beginners, just keep&amp;nbsp;few things in your mind that&amp;nbsp; used&amp;nbsp;&amp;nbsp;of&amp;nbsp;&amp;nbsp;* with select statement is not recommended at all, it can lead to poor sql query performance because indexes which exists in table may not&amp;nbsp;selected by query optimizer due to *&amp;nbsp; used in select query. It could be big topic if we think about the reasons that why indexes are not being used by query optimizer, I will discuss the same in my next blog.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Cluster index should placed&amp;nbsp;&lt;/u&gt;&amp;nbsp; &lt;/strong&gt;Another important thing, cluster index which should be placed on table.&lt;br /&gt;
When creating primary key on table, itself it create cluster index on table and this way initially query performance definitely can be boost.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Missing non cluster indexes&amp;nbsp;&lt;/u&gt;&lt;/strong&gt;&amp;nbsp;&amp;nbsp;Other than cluster index, non cluster indexes&amp;nbsp;can be &amp;nbsp;used and placed on table to &lt;span style=&quot;background-color: white;&quot;&gt;enhance further query performance. Following script can suggest the indexes which is required by query optimizer however before implement missing indexes, necessary impact analysis should be performed by developer/DBA.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black; font-size: x-small;&quot;&gt;SELECT &#39;------MISSING INDEXES--------------&#39;&lt;br /&gt;
SELECT&amp;nbsp; DB_NAME(D.DATABASE_ID) DBNAME,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OBJECT_NAME(D.OBJECT_ID) TABLENAME,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowC.row_count,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D.INDEX_HANDLE,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D.EQUALITY_COLUMNS,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D.INEQUALITY_COLUMNS,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D.INCLUDED_COLUMNS,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D.STATEMENT AS FULLY_QUALIFIED_OBJECT,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GS.*&lt;br /&gt;
FROM&amp;nbsp;&amp;nbsp;&amp;nbsp; SYS.DM_DB_MISSING_INDEX_GROUPS G&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JOIN SYS.DM_DB_MISSING_INDEX_GROUP_STATS GS ON GS.GROUP_HANDLE = G.INDEX_GROUP_HANDLE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JOIN SYS.DM_DB_MISSING_INDEX_DETAILS D ON G.INDEX_HANDLE = D.INDEX_HANDLE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Join ( SELECT&amp;nbsp;&amp;nbsp; OBJECT_NAME(OBJECT_ID) TableName,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; st.row_count&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.dm_db_partition_stats st&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp; index_id &amp;lt; 2&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) As RowC on RowC.tablename = OBJECT_NAME(D.OBJECT_ID)&lt;br /&gt;
WHERE&amp;nbsp;&amp;nbsp; D.DATABASE_ID = D.DATABASE_ID&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND D.OBJECT_ID = D.OBJECT_ID&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND D.DATABASE_ID = db_id() &lt;br /&gt;
&amp;nbsp; --and OBJECT_NAME(D.OBJECT_ID)=&#39;TableName&#39;-- Table Name&lt;br /&gt;
Order by last_user_seek desc&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;background-color: white; color: black;&quot;&gt;As discussed, &lt;span style=&quot;color: black;&quot;&gt;these&lt;/span&gt; are few steps which definitely improves the performance of sql query.&lt;br /&gt;
I will elaborate many things in my next blog which are missed here.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #ead1dc;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Rajnish Awasthi&lt;br /&gt;
Sr. Consultant&lt;br /&gt;
MCTS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rajnish-awasthi.blogspot.com/feeds/5754150500416043967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajnish-awasthi.blogspot.com/2011/10/sql-query-running-slow.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7665562022538976949/posts/default/5754150500416043967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7665562022538976949/posts/default/5754150500416043967'/><link rel='alternate' type='text/html' href='http://rajnish-awasthi.blogspot.com/2011/10/sql-query-running-slow.html' title='SQL Query Running Slow !'/><author><name>Rajnish Awasthi</name><uri>http://www.blogger.com/profile/16093624315107523775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkqQ3jydiVRLCI1vgVAv1-FLTTYnSHmzw8tVC_-909qHEkybYbVKG5nKFHUof22a5DJcvoO1gr9IzJDUFIulfEvj3eCxkrzH4s5EDDfdX0RMPcACLRp67jZ-eR470z/s220/rajnish.jpg'/></author><thr:total>2</thr:total></entry></feed>