﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Mohd Nizamuddin  / Indexed View / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 03:34:23 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>[quote][b]Ray Laubert (12/8/2009)[/b][hr]Wasn't sure about CharIndex ...Has anyone ever used CharIndex on an indexed view?[/quote]But this was not because of the null reason...</description><pubDate>Tue, 15 Dec 2009 01:43:54 GMT</pubDate><dc:creator>BudaCli</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>What's about this question?In SQL 2000 - CharIndex is nondeterministichttp://msdn.microsoft.com/en-us/library/aa214775(SQL.80).aspxIn SQL 2005 - CharIndex is deterministichttp://msdn.microsoft.com/en-us/library/ms178091(SQL.90).aspxSorry, but question didn't precise about which version sql server was going.Please give me my lost point :)</description><pubDate>Thu, 10 Dec 2009 07:50:30 GMT</pubDate><dc:creator>stoklosa</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>[quote][b]Ray Laubert (12/8/2009)[/b][hr]Thanks, that is what I would have expected.   CharIndex would create a situation that invalidates the Index View and basically forces SQL to the underlying tables.But this does not in itself invalidate the question.[/quote]You are right it doesn't invalidate the question, but it is misleading information to everyone trying to create an indexed view with char index, and I think that is a bad.</description><pubDate>Wed, 09 Dec 2009 01:46:42 GMT</pubDate><dc:creator>hakan.winther</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>Thanks a lot Steve.</description><pubDate>Tue, 08 Dec 2009 21:04:32 GMT</pubDate><dc:creator>mohd.nizamuddin</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>You have to add the noexpand hint to the query to use the view's index.  The noexpand hint forces the optimizer to use the views data instead of the underlying tables and indexes.  You have to remember that the optimizer is still cost efficient and sometimes it thinks the using the underlying data is cheaper than using the view data, which may be true in certain cases.  Anyway you must use the noexpand hint to make the optimizer look at the view and its indexes only.  On the flip side, you can use the expand hint to make the optimizer expand the view.</description><pubDate>Tue, 08 Dec 2009 16:06:38 GMT</pubDate><dc:creator>Adam Haines</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>Thanks, that is what I would have expected.   CharIndex would create a situation that invalidates the Index View and basically forces SQL to the underlying tables.But this does not in itself invalidate the question.</description><pubDate>Tue, 08 Dec 2009 09:34:46 GMT</pubDate><dc:creator>Ray Laubert</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>I tried an example containing a charindex column in SQL2005, and while it did create the index on the view, the following warning was shown when it was created.Warning: The optimizer cannot use the index because the select list of the view contains a non-aggregate expression.The execution plan for queries using the view show the use of indexes on the underlying tables, rather than the index on the view.So, while the system allows you to create an index on a view containing a charindex column, it doesn't appear to be of any use.</description><pubDate>Tue, 08 Dec 2009 08:40:18 GMT</pubDate><dc:creator>Mike Mullen</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>Wasn't sure about CharIndex since it can return a null value and which could invalidate the index statement for the view.  Has anyone ever used CharIndex on an indexed view?</description><pubDate>Tue, 08 Dec 2009 07:28:39 GMT</pubDate><dc:creator>Ray Laubert</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>Explanation corrected.</description><pubDate>Tue, 08 Dec 2009 07:24:09 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>[quote][b]hakan.winther (12/8/2009)[/b][hr][quote][b]vk-kirov (12/8/2009)[/b][hr][quote][b]mohd.nizamuddin (12/8/2009)[/b][hr]However, in the example the functions Count(*), SUM, MAX, MIN etc are not a deterministic function.[/quote]This is incorrect.[quote]All of the [b]aggregate[/b] and string built-in functions are [b]deterministic[/b].[/quote][/quote]Count is a deterministic function, but it is not allowed anyway. You should use COUNT_BIG instead.[/quote]I know this :-) What I only said is: "aggregate functions are deterministic", nothing about indexed views :-)</description><pubDate>Tue, 08 Dec 2009 06:38:23 GMT</pubDate><dc:creator>vk-kirov</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>[quote][b]vk-kirov (12/8/2009)[/b][hr][quote][b]mohd.nizamuddin (12/8/2009)[/b][hr]However, in the example the functions Count(*), SUM, MAX, MIN etc are not a deterministic function.[/quote]This is incorrect. Check BOL (Deterministic and Nondeterministic Functions): [url]http://msdn.microsoft.com/en-us/library/ms178091.aspx[/url][quote]All of the [b]aggregate[/b] and string built-in functions are [b]deterministic[/b].[/quote][/quote]Count is a deterministic function, but it is not allowed anyway. You should use COUNT_BIG instead.</description><pubDate>Tue, 08 Dec 2009 05:39:14 GMT</pubDate><dc:creator>hakan.winther</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>Exactly, aggregate functions are deterministic. So they are allowed in indexed view. "Correct" answer is incorrect! :-)Deterministic and Nondeterministic Functions:http://msdn.microsoft.com/en-us/library/ms178091.aspx</description><pubDate>Tue, 08 Dec 2009 03:33:23 GMT</pubDate><dc:creator>ser_s</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>[quote][b]mohd.nizamuddin (12/8/2009)[/b][hr]However, in the example the functions Count(*), SUM, MAX, MIN etc are not a deterministic function.[/quote]This is incorrect. Check BOL (Deterministic and Nondeterministic Functions): [url]http://msdn.microsoft.com/en-us/library/ms178091.aspx[/url][quote]All of the [b]aggregate[/b] and string built-in functions are [b]deterministic[/b].[/quote]</description><pubDate>Tue, 08 Dec 2009 02:31:47 GMT</pubDate><dc:creator>vk-kirov</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>Hi,Thanks a lot,[quote][b]CirquedeSQLeil (12/7/2009)[/b][hr]The wording in the explanation don't seem to match the documentation.[url]http://msdn.microsoft.com/en-us/library/ms191432(SQL.90).aspx[/url]Explanation said that the view must not contain any deterministic functions.  The referenced article states that functions must be deterministic and then continues to lay out what is not acceptable.[/quote]Actually the explanation should be like "When you create an indexed view, the view definition must not contain any [b][i]non-[/i][/b] deterministic functions". However, in the example the functions Count(*), SUM, MAX, MIN etc are not a deterministic function.</description><pubDate>Tue, 08 Dec 2009 00:54:57 GMT</pubDate><dc:creator>mohd.nizamuddin</dc:creator></item><item><title>RE: Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>The wording in the explanation don't seem to match the documentation.[url]http://msdn.microsoft.com/en-us/library/ms191432(SQL.90).aspx[/url]Explanation said that the view must not contain any deterministic functions.  The referenced article states that functions must be deterministic and then continues to lay out what is not acceptable.</description><pubDate>Mon, 07 Dec 2009 23:40:40 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>Indexed View</title><link>http://www.sqlservercentral.com/Forums/Topic830442-1618-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/T-SQL/67618/"&gt;Indexed View&lt;/A&gt;[/B]</description><pubDate>Mon, 07 Dec 2009 23:37:36 GMT</pubDate><dc:creator>mohd.nizamuddin</dc:creator></item></channel></rss>