Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««1234»»

SET Options - 1 Expand / Collapse
Author
Message
Posted Friday, December 14, 2012 11:09 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, September 11, 2014 5:47 AM
Points: 864, Visits: 865
Toreador (12/14/2012)
Thanks for the easy question to end the week!



Hey, what did I tell you??!!! >>>SMACK<<<



ron


-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown
Post #1396755
Posted Friday, December 14, 2012 11:58 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 11:54 AM
Points: 4,427, Visits: 3,423
Ron, you made me scratch my head a lot... Thanks!
Post #1396771
Posted Friday, December 14, 2012 11:58 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, September 11, 2014 8:33 AM
Points: 3,313, Visits: 1,984
Nice question.
Post #1396772
Posted Friday, December 14, 2012 12:45 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232, Visits: 1,046
Hugo Kornelis (12/14/2012) -
The reason for this limitation? (Puts on speculative hat) Many settings are discouraged anyway, and I guess that MS decided not to put in extra engineering effort to support and test indexed views (and several other features with similar limitations) under all those settings. So they simply forbid them.


Now I understand why speculation is considered a negative speech pattern.
Hugo, If you take a look at the SQL documentation the reason is clear.

Even if an expression is deterministic, if it contains float expressions, the exact result may depend on the processor architecture or version of microcode. To ensure data integrity, such expressions can participate only as non-key columns of indexed views. Deterministic expressions that do not contain float expressions are called precise. Only precise deterministic expressions can participate in key columns and in WHERE or GROUP BY clauses of indexed views.


How would the database engine test the values of an indexed view for the right data percision when executing or running the TSQL from a client if that client connection has the SET option ARITHABORT turned ON?

Apparently this has nothing to do with the testing practices of MS Engineers.
More likely it is the testing done by the Database Engine to data and columns that are to be included in the indexed view.
In this specific example it is the testing of the data being inserted into a column that is participating in the indexed view.
All of the above need to check the percision of the Data Types and that requires SET ARITHABORT OFF and several other OFF
When creating and manipulating indexes on computed columns or indexed views, the SET options ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER, ANSI_NULLS, ANSI_PADDING, and ANSI_WARNINGS must be set to ON. The option NUMERIC_ROUNDABORT must be set to OFF.
If any of these options are not set to the required values, INSERT, UPDATE, and DELETE actions on indexed views or tables with indexes on computed columns will fail. SQL Server will raise an error listing all the options that are incorrectly set. Also, SQL Server will process SELECT statements on these tables or indexed views as though the indexes on computed columns or on the views do not exist.

http://msdn.microsoft.com/en-us/library/aa259205(v=sql.80).aspx
Like my grandfather always said; "You are served better by knowing how to read than how to write."
Post #1396789
Posted Friday, December 14, 2012 2:20 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 7:06 PM
Points: 8,820, Visits: 9,379
Excellent question.

Tom
Post #1396815
Posted Saturday, December 15, 2012 7:09 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, August 28, 2014 8:53 PM
Points: 1,521, Visits: 3,039
SanDroid, your explanation has me puzzled. The first quote says that one cannot use an expression containing a float expression in the key column of an indexed view. By itself, this would appear not to apply to the QOD situation where the index is based on an INT column. How then is this a clear explanation for prohibiting the use of an index on a view if Numeric_RoundAbort is On? Wouldn't that setting only affect the evaluation of an expression that depended on a float or other expression that's not strictly deterministic at the lowest (machine) level?

The second part of your explanation didn't help me any more than the first. You pose an apparently rhetorical question, "How would the database engine test the values of an indexed view for the right data percision when executing or running the TSQL from a client if that client connection has the SET option ARITHABORT turned ON?" I don't follow why that setting (or NUMERIC_ROUNDABORT turned OFF as I think you may have meant) would affect what the engine would do with an INT column.

Your final paragraph actually echoes Hugo when you say it seems likely the engine would have to test the absolute deterministic characteristics of all components of the view index. If I may take that thought forward, wouldn't that mean the engine instead just says "if NUMERIC_ROUNDABORT is OFF, then non-deterministic values COULD be there, and I don't want to go looking for that possibility deep down inside". This would be how I understood Hugo's speculation, back where we started. Can this be cleared up WITHOUT speculation?
Post #1396934
Posted Monday, December 17, 2012 12:46 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, August 6, 2014 12:09 AM
Points: 302, Visits: 178
Argh!

I did read the docs, but I got too focused on the index creation itself, which will fail if numeric_roundabort is on, but the info on update/insert etc. didn't really sink in.

Thank you for the question.
Post #1397115
Posted Monday, December 17, 2012 5:28 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:42 AM
Points: 58, Visits: 213
I love indexed views

Actually I hate indexed views
Actually I love indexed views
Actually I hate indexed views
Actually I love indexed views
Actually I hate indexed views
Actually I love indexed views
Actually I hate indexed views
Actually I love indexed views

etc etc etc.

Actually, they are good sometimes but seldom worth the effort




David Bridge
David Bridge Technology Limited
www.davidbridgetechnology.com
Post #1397208
Posted Monday, December 17, 2012 9:08 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, February 20, 2013 1:45 AM
Points: 616, Visits: 97
Learnt something new...
Post #1397533
Posted Tuesday, December 18, 2012 11:50 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:01 AM
Points: 11,194, Visits: 11,165
john.arnott (12/15/2012)
SanDroid, your explanation has me puzzled. The first quote says that one cannot use an expression containing a float expression in the key column of an indexed view. By itself, this would appear not to apply to the QOD situation where the index is based on an INT column. How then is this a clear explanation for prohibiting the use of an index on a view if Numeric_RoundAbort is On? Wouldn't that setting only affect the evaluation of an expression that depended on a float or other expression that's not strictly deterministic at the lowest (machine) level?

The second part of your explanation didn't help me any more than the first. You pose an apparently rhetorical question, "How would the database engine test the values of an indexed view for the right data percision when executing or running the TSQL from a client if that client connection has the SET option ARITHABORT turned ON?" I don't follow why that setting (or NUMERIC_ROUNDABORT turned OFF as I think you may have meant) would affect what the engine would do with an INT column.

Your final paragraph actually echoes Hugo when you say it seems likely the engine would have to test the absolute deterministic characteristics of all components of the view index. If I may take that thought forward, wouldn't that mean the engine instead just says "if NUMERIC_ROUNDABORT is OFF, then non-deterministic values COULD be there, and I don't want to go looking for that possibility deep down inside". This would be how I understood Hugo's speculation, back where we started. Can this be cleared up WITHOUT speculation?

Thanks for writing this so I didn't have to




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #1398201
« Prev Topic | Next Topic »

Add to briefcase «««1234»»

Permissions Expand / Collapse