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 «««123

Index types 1 Expand / Collapse
Author
Message
Posted Monday, August 6, 2012 8:12 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 11:43 AM
Points: 6,149, Visits: 8,409
sknox (8/6/2012)
Hugo, I can see why you didn't want the "choose 3" text there -- for many of us it takes a question with 31 possible answers (2^5 -1 since I believe choosing 0 answers is not an option in this system down to a choice of 3 (if you got the non-unique clustered index) or 6 (if you weren't sure of the non-unique clustered index.)

I prefer not to think of it as a single question with 31 possible answers, but as six simple yes/no questions (with the additional information that at least two of them need to have a "yes" answer).

((And for the pedantic among us, it's actually 57 possible answers (2^6 - 1 - 6) as I did provide the note about "multiple answers" being correct - so all six options with only one tick can be discarded, as can the option with no correct answer. And for the record, the QotD software forces the author to mark at least one answer as correct, and will automatically present the answer options as either radio buttons or tick marks depending on the number of correct options.))


m mcdonald (8/6/2012)
Nice. I found this link very helpful...

http://msdn.microsoft.com/en-us/library/ms175049.aspx

I deliberately didn't include that link, as I think the information is presented there in a very confusing way. This has already resulted in two highly controversial QotD's. (One of them in fact was my inspiration for this question).



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1340643
Posted Monday, August 6, 2012 8:21 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 5:23 PM
Points: 1,391, Visits: 1,758
Hugo Kornelis (8/6/2012)
sknox (8/6/2012)
Hugo, I can see why you didn't want the "choose 3" text there -- for many of us it takes a question with 31 possible answers (2^5 -1 since I believe choosing 0 answers is not an option in this system down to a choice of 3 (if you got the non-unique clustered index) or 6 (if you weren't sure of the non-unique clustered index.)

I prefer not to think of it as a single question with 31 possible answers, but as six simple yes/no questions (with the additional information that at least two of them need to have a "yes" answer).

((And for the pedantic among us, it's actually 57 possible answers (2^6 - 1 - 6) as I did provide the note about "multiple answers" being correct - so all six options with only one tick can be discarded, as can the option with no correct answer. And for the record, the QotD software forces the author to mark at least one answer as correct, and will automatically present the answer options as either radio buttons or tick marks depending on the number of correct options.))


Actually by "for many of us" I was indicating the fact that the unique non-clustered option was pretty much a given (at this time 90% of respondents get this one correct.) That leaves 5 answers, of which at least one must be selected to make it a true multiple answer question -- that gives us the 2^5-1 = 31.

But then I did mess up in the "choose 3" calculation. If you were correctly confident of the non-unique clustered index answer, then you'd have 2 and need one more out of 4. If you weren't confident of that one, you'd need 2 out of 5, of which there are 10 unique combinations.
Post #1340653
Posted Monday, August 6, 2012 10:08 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: 2 days ago @ 10:29 AM
Points: 1,457, Visits: 1,411
Not so much the information on that "landing page" as much as the additional links to additional information regarding each index type.

Worked for me this time


Cheers.
Post #1340734
Posted Tuesday, August 7, 2012 6:53 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:39 AM
Points: 5,370, Visits: 9,017
Hugo Kornelis (8/6/2012)
m mcdonald (8/6/2012)
Nice. I found this link very helpful...

http://msdn.microsoft.com/en-us/library/ms175049.aspx

I deliberately didn't include that link, as I think the information is presented there in a very confusing way. This has already resulted in two highly controversial QotD's. (One of them in fact was my inspiration for this question).


Well, I believe that I'm the author of one of those "highly controversial QotD's", and I just have to say... great question. It really makes one think. Especially with the newer index types (columnstore, and spatial (okay, 2008, but I've never used it or the XML ones yet)).

Since the title is "Index types 1"... are there more coming?


Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #1341209
Posted Tuesday, August 7, 2012 7:25 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 11:43 AM
Points: 6,149, Visits: 8,409
WayneS (8/7/2012)
Hugo Kornelis (8/6/2012)
m mcdonald (8/6/2012)
Nice. I found this link very helpful...

http://msdn.microsoft.com/en-us/library/ms175049.aspx

I deliberately didn't include that link, as I think the information is presented there in a very confusing way. This has already resulted in two highly controversial QotD's. (One of them in fact was my inspiration for this question).


Well, I believe that I'm the author of one of those "highly controversial QotD's", and I just have to say... great question. It really makes one think. Especially with the newer index types (columnstore, and spatial (okay, 2008, but I've never used it or the XML ones yet)).

Since the title is "Index types 1"... are there more coming?

For the record, I don't blame the authors of those questions; I blame the confusing language in the BOL article, since it confuses types with attributes. For instance, if a unique index is a type and an index with included columns is a type, then what about a unique index with included columns? And why would an index on a computed column be a seperate type, but an index on a view not? (In fact, why not go the whole way and say that an index on three columns is a seperate type, or an index on a varchar column?)

I think most people would agree that spatial, xml, and freetext are all seperate index types. For clustered/nonclustered, you'd get more debate. And for unique, computed columns, included columns and filtered indexes, I'd expect most people to not consider them as index types, but rather as index attributes.

(As such, you might argue that my use of the word "types" in the question is not correct - but I think it is clear enough for all that my question focuses on which combinations are correct and which are not).


And to answer your last question: yes, I submitted a second, similar question. I thought it was supposed to be published next week, but when I just double checked I noticed that the status is "Submitted, awaiting approval" so I have no idea when it will run.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1341234
Posted Tuesday, August 7, 2012 8:16 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 5:46 AM
Points: 1,834, Visits: 6,657
Well I got it wrong, despite already using XML indexes.

I suspect this is because the question made no mention of the date format set on the database
Post #1341290
Posted Wednesday, August 8, 2012 5:43 PM


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: 2 days ago @ 11:31 AM
Points: 3,422, Visits: 2,038
Nice question! Learned something new. Thanks Hugo!
Post #1342316
Posted Saturday, August 11, 2012 7:49 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:18 PM
Points: 7,930, Visits: 9,654
Nice question and good explanation.

But one niggle - either the explanation is wrong about NONCLUSTERED being a mandatory keyword for CREATE COLUMNSTORE INDEX, of BoL (the page you reference in the explanation) is wrong about it being an optional keyword - it's shown in option brackets in the BNF description of the statement syntax, so that it appears that although the index must be nonclustered it isn't neccessary to supply the keyword. I don't have SQL 2012 handy so can't check whether this is a BoL error or not.


Tom
Post #1343793
Posted Saturday, August 11, 2012 9:47 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 11:43 AM
Points: 6,149, Visits: 8,409
L' Eomot Inversé (8/11/2012)
But one niggle - either the explanation is wrong about NONCLUSTERED being a mandatory keyword for CREATE COLUMNSTORE INDEX, of BoL (the page you reference in the explanation) is wrong about it being an optional keyword - it's shown in option brackets in the BNF description of the statement syntax, so that it appears that although the index must be nonclustered it isn't neccessary to supply the keyword. I don't have SQL 2012 handy so can't check whether this is a BoL error or not.

You are absolutely right, Tom. I made a mistake there. Luckily, the mistake doesn't affect the correctness of the answer. The keyword NONCLUSTERED is optional, but if you leave it out you still get a nonclustered columnstore index - and if you change it to clustered, you get an error message stating that clustered columnstore indexes are not supported.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1343804
Posted Wednesday, September 19, 2012 5:57 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 11:44 AM
Points: 2,509, Visits: 1,592
Nice question! Had to dig a little to find out part of the XML index strategy but learned something new in the process. Thanks Hugo!

Not all gray hairs are Dinosaurs!
Post #1361699
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse