<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER – Index Created on View not Used Often – Limitation of the View 3</title>
	<atom:link href="http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #008 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-397395</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #008 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 22 Dec 2012 01:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-397395</guid>
		<description><![CDATA[[...] Index Created on View not Used Often – Limitation of the View 3 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Index Created on View not Used Often – Limitation of the View 3 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-196304</link>
		<dc:creator><![CDATA[Tim]]></dc:creator>
		<pubDate>Tue, 15 Nov 2011 20:25:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-196304</guid>
		<description><![CDATA[Is there any point in creating indices on a UNION ALL view when the tables involved in the UNION already are indexed?

In my case, I have a UNION ALL view involving SELECTs on two tables. One table contains a few hundred thousand rows. The other table contains over a million rows. Both tables are already indexed. Could I gain anything by creating indices on the view?]]></description>
		<content:encoded><![CDATA[<p>Is there any point in creating indices on a UNION ALL view when the tables involved in the UNION already are indexed?</p>
<p>In my case, I have a UNION ALL view involving SELECTs on two tables. One table contains a few hundred thousand rows. The other table contains over a million rows. Both tables are already indexed. Could I gain anything by creating indices on the view?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Data Warehouseing Concepts – Day 20 of 31 Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-149462</link>
		<dc:creator><![CDATA[SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Data Warehouseing Concepts – Day 20 of 31 Journey to SQLAuthority]]></dc:creator>
		<pubDate>Wed, 20 Jul 2011 01:31:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-149462</guid>
		<description><![CDATA[[...] (Read more here) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] (Read more here) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumar</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-88050</link>
		<dc:creator><![CDATA[kumar]]></dc:creator>
		<pubDate>Thu, 16 Sep 2010 18:40:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-88050</guid>
		<description><![CDATA[Please try with this code
Select sum(select top100 col1 from table) from table]]></description>
		<content:encoded><![CDATA[<p>Please try with this code<br />
Select sum(select top100 col1 from table) from table</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: happy</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-87994</link>
		<dc:creator><![CDATA[happy]]></dc:creator>
		<pubDate>Thu, 16 Sep 2010 05:45:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-87994</guid>
		<description><![CDATA[good morning sir

 i have 1 col in salary of employee table

salary
15000
12000
13000
18000
40000
20000
12000
16000
8000
6000
3500
12000
means total col of salary 200 but i want to sum only 100 col
i knew that if i want a that sum of  200 col use select sum(salary) from table name but i want sum only for 100 col
then i don&#039;t know about this question plz sir solve this query
thanks in advance]]></description>
		<content:encoded><![CDATA[<p>good morning sir</p>
<p> i have 1 col in salary of employee table</p>
<p>salary<br />
15000<br />
12000<br />
13000<br />
18000<br />
40000<br />
20000<br />
12000<br />
16000<br />
8000<br />
6000<br />
3500<br />
12000<br />
means total col of salary 200 but i want to sum only 100 col<br />
i knew that if i want a that sum of  200 col use select sum(salary) from table name but i want sum only for 100 col<br />
then i don&#8217;t know about this question plz sir solve this query<br />
thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-87993</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Thu, 16 Sep 2010 05:23:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-87993</guid>
		<description><![CDATA[Well then there&#039;s definetely something wrong with the stored proc. Unless you have gazillion size database of course.

I would do couple of things first. I would start with checking if there&#039;s something fundamentally wrong, something like normal programming problems, large nested loops for example.

Then I&#039;d check that if the procedures are making queries that are missing indexes. Especially non-indexed NOT IN queries and datetime fields can take up a lot of time to finish. In one case I dropped 4 minute query to milliseconds just by adding index to datetime field which was used in ORDER BY.

Then I would just go by hunch. Maybe check execution plan, try tuning advisor, go through the proc line-by-line and poke here and there. Unfortunately I can&#039;t be very specific about this since I&#039;d have to see the proc and have your data to test it.]]></description>
		<content:encoded><![CDATA[<p>Well then there&#8217;s definetely something wrong with the stored proc. Unless you have gazillion size database of course.</p>
<p>I would do couple of things first. I would start with checking if there&#8217;s something fundamentally wrong, something like normal programming problems, large nested loops for example.</p>
<p>Then I&#8217;d check that if the procedures are making queries that are missing indexes. Especially non-indexed NOT IN queries and datetime fields can take up a lot of time to finish. In one case I dropped 4 minute query to milliseconds just by adding index to datetime field which was used in ORDER BY.</p>
<p>Then I would just go by hunch. Maybe check execution plan, try tuning advisor, go through the proc line-by-line and poke here and there. Unfortunately I can&#8217;t be very specific about this since I&#8217;d have to see the proc and have your data to test it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumar</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-87952</link>
		<dc:creator><![CDATA[kumar]]></dc:creator>
		<pubDate>Wed, 15 Sep 2010 18:32:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-87952</guid>
		<description><![CDATA[Thanks for reply Marko,

But when i see the data from report server database maximum amount was taken by take stored procedure to excute the data.
i saw some reports as taken almost 2hours 10 mins in that 95% by data reterival by stored procedure and remaining else 5% and in another case 40% by stored procedure and remaining by excuting the report.


Thanks in advance]]></description>
		<content:encoded><![CDATA[<p>Thanks for reply Marko,</p>
<p>But when i see the data from report server database maximum amount was taken by take stored procedure to excute the data.<br />
i saw some reports as taken almost 2hours 10 mins in that 95% by data reterival by stored procedure and remaining else 5% and in another case 40% by stored procedure and remaining by excuting the report.</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-87888</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Wed, 15 Sep 2010 05:32:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-87888</guid>
		<description><![CDATA[Run the procedure from SSMS and see how long it takes. If it returns in a minute or two and the application is taking 30 minutes to finish then the problem must be in the application code and not in the procedure.]]></description>
		<content:encoded><![CDATA[<p>Run the procedure from SSMS and see how long it takes. If it returns in a minute or two and the application is taking 30 minutes to finish then the problem must be in the application code and not in the procedure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumar</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-87850</link>
		<dc:creator><![CDATA[kumar]]></dc:creator>
		<pubDate>Tue, 14 Sep 2010 18:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-87850</guid>
		<description><![CDATA[Hi Pinal,


Our team faced an issue in reporting services. We use stored procedures in ssrs. our stored procedure mostly executes max with in 1- 3mins( depends on customer),But in application it takes more than 30 mins. so my manager wants me to optimize the stored procedure it might decrease in application to get the report.
Please help me out with some kind of suggestions.

Thanks in advance]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Our team faced an issue in reporting services. We use stored procedures in ssrs. our stored procedure mostly executes max with in 1- 3mins( depends on customer),But in application it takes more than 30 mins. so my manager wants me to optimize the stored procedure it might decrease in application to get the report.<br />
Please help me out with some kind of suggestions.</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nisarg Kothari</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-87323</link>
		<dc:creator><![CDATA[Nisarg Kothari]]></dc:creator>
		<pubDate>Fri, 10 Sep 2010 05:43:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-87323</guid>
		<description><![CDATA[sorry 

queries like

‘SELECT * FROM A LEFT JOIN B ON (A.ID = B.ID)’ or
‘SELECT * FROM B RIGHT JOIN A ON (A.ID = B.ID)’]]></description>
		<content:encoded><![CDATA[<p>sorry </p>
<p>queries like</p>
<p>‘SELECT * FROM A LEFT JOIN B ON (A.ID = B.ID)’ or<br />
‘SELECT * FROM B RIGHT JOIN A ON (A.ID = B.ID)’</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nisarg Kothari</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-87322</link>
		<dc:creator><![CDATA[Nisarg Kothari]]></dc:creator>
		<pubDate>Fri, 10 Sep 2010 05:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-87322</guid>
		<description><![CDATA[Hi Pinal,

I am working with SQL Server since 2 years, I know the difference between &#039;RIGHT OUTER JOIN&#039; and &#039;LEFT OUTER JOIN&#039;, I know when to use &#039;RIGHT OUTER JOIN&#039; or &#039;LEFT OUTER JOIN&#039;. but the thing is that which one is better...
&#039;SELECT * FROM A LEFT JOIN B ON (A.ID = B.ID)&#039; or
&#039;SELECT * FROM B LEFT JOIN A ON (A.ID = B.ID)&#039; .....]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>I am working with SQL Server since 2 years, I know the difference between &#8216;RIGHT OUTER JOIN&#8217; and &#8216;LEFT OUTER JOIN&#8217;, I know when to use &#8216;RIGHT OUTER JOIN&#8217; or &#8216;LEFT OUTER JOIN&#8217;. but the thing is that which one is better&#8230;<br />
&#8216;SELECT * FROM A LEFT JOIN B ON (A.ID = B.ID)&#8217; or<br />
&#8216;SELECT * FROM B LEFT JOIN A ON (A.ID = B.ID)&#8217; &#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2010/09/06/sql-server-index-created-on-view-not-used-often-limitation-of-the-view-3/#comment-86782</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Mon, 06 Sep 2010 16:01:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10093#comment-86782</guid>
		<description><![CDATA[Hi Pinal,

You are right. View might get expanded so that the actual data is read from the table instead of the view. Like you said NOEXPAND prevents expanding so if you run following queries you&#039;ll see the difference:

SELECT ID1,ID2,SomeData
FROM mySampleTable

SELECT ID1,ID2,SomeData
FROM SampleView
WITH (NOEXPAND)

The latter one should have lower query cost compared to the former one.

But the example is, forgive me, pretty bad one. Indexed view does not do any good in this situation since the view is actually as big as the original table. The real benefits lies in joins and aggregations of large datasets. I urge everyone to read more from here:

http://technet.microsoft.com/en-us/library/cc917715.aspx

There&#039;s lots of stuff which I didn&#039;t know even existed, like all those SET options which must be set before creating and index to the view.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>You are right. View might get expanded so that the actual data is read from the table instead of the view. Like you said NOEXPAND prevents expanding so if you run following queries you&#8217;ll see the difference:</p>
<p>SELECT ID1,ID2,SomeData<br />
FROM mySampleTable</p>
<p>SELECT ID1,ID2,SomeData<br />
FROM SampleView<br />
WITH (NOEXPAND)</p>
<p>The latter one should have lower query cost compared to the former one.</p>
<p>But the example is, forgive me, pretty bad one. Indexed view does not do any good in this situation since the view is actually as big as the original table. The real benefits lies in joins and aggregations of large datasets. I urge everyone to read more from here:</p>
<p><a href="http://technet.microsoft.com/en-us/library/cc917715.aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/cc917715.aspx</a></p>
<p>There&#8217;s lots of stuff which I didn&#8217;t know even existed, like all those SET options which must be set before creating and index to the view.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
