Indexing

  • My apologies. I think I cut and pasted the drop in the wrong spot when this was proofed. It definitely ran correctly when it was tested.

    I will award points back to those who have attempted it already.

  • The question is interesting but I do wonder why would someone would disable a clustered index?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Interesting, very interesting - thanks, Chirag!

  • Steve Jones - SSC Editor (6/14/2013)


    My apologies. I think I cut and pasted the drop in the wrong spot when this was proofed. It definitely ran correctly when it was tested.

    I will award points back to those who have attempted it already.

    Thanks very much Steve..

  • L' Eomot Inversรฉ (6/14/2013)


    This would have been a good question if the author had checked that it produced the expect result before he submitted it, and corrected it when he discovered that instead of 3 rows the select returned an error. As it is, it's not actually as bad as yesterday's question, but it's not really very good either.

    Agree Tom - hence my question earlier

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. โ€• Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • Good question... apparently especially after Steve fixed it.

    ๐Ÿ™‚



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Luis Cazares (6/14/2013)


    The question is interesting but I do wonder why would someone would disable a clustered index?

    ETL loads is one reason. It can be faster to load without indexes and rebuild.

    This question shows what might happen if you didn't enable the index later.

  • Steve Jones - SSC Editor (6/14/2013)


    Luis Cazares (6/14/2013)


    The question is interesting but I do wonder why would someone would disable a clustered index?

    ETL loads is one reason. It can be faster to load without indexes and rebuild.

    That would be the reason for disabling nonclustered indexes. Disabling a clustered index prevents all access to the table, both reads and writes. So the ETL job would fail.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Thanks for the correction, Hugo. Moving too fast today.

    Not sure why you would disable a clustered index then. Perhaps it was included to keep consistent syntax for all indexes? Seems strange.

  • Nice question. I got to it after it had been corrected and everything made sense. Glad I didn't have to guess as others did earlier!

  • Steve Jones - SSC Editor (6/14/2013)


    Thanks for the correction, Hugo. Moving too fast today.

    Not sure why you would disable a clustered index then. Perhaps it was included to keep consistent syntax for all indexes? Seems strange.

    Just syntax consistency, I imagine. If there had been an idea to disable a table, there would have been a "disable table" command to cope with heaps as well as tables with CIs, probably.

    Tom

  • Luis Cazares (6/14/2013)


    The question is interesting but I do wonder why would someone would disable a clustered index?

    They wouldn't - but the question shows you what would happen if they inadvertently tried it ๐Ÿ™‚

  • L' Eomot Inversรฉ (6/14/2013)


    This would have been a good question if the author had checked that it produced the expect result before he submitted it, and corrected it when he discovered that instead of 3 rows the select returned an error. As it is, it's not actually as bad as yesterday's question, but it's not really very good either.

    Tend to agree here.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • They wouldn't - but the question shows you what would happen if they inadvertently tried it ๐Ÿ™‚

    Agreed | Good question - thanks for sharing ๐Ÿ™‚ +1

    MCTS | MCITP | Microsoft SQL Server 2008 Administration & Development
    MCSA | MCSE | Business Intelligence SQL Server 2012

  • I found it simple and good question for QOTD. ๐Ÿ™‚

Viewing 15 posts - 16 through 29 (of 29 total)

You must be logged in to reply to this topic. Login to reply