Know Your SQL Objects

  • Paul Randal (5/13/2011)


    Steve - I got this wrong because your wording is broken. Extents can NOT be owned by multiple objects. When an extent is a mixed extent, it is 'owned' by the allocation system - technically object ID 99. The individual pages are owned by multiple objects, but none of the objects own the extent.

    Paul! Please tell M$ for us that the BOL needs to be updated to show this... Currently it does not agree with you great statement

    To make its space allocation efficient, SQL Server does not allocate whole extents to tables with small amounts of data. SQL Server has two types of extents:

    Uniform extents are owned by a single object; all eight pages in the extent can only be used by the owning object.

    Mixed extents are shared by up to eight objects. Each of the eight pages in the extent can be owned by a different object.

    Shared ownership is not exclusive ownership.

    I am certain your statement is true.

    However, if 8 differant object id's own the data in the extent pages, don't 8 differant object_id own the extent as well?

  • Ninja's_RGR'us (5/13/2011)


    SanDroid (5/13/2011)


    Steve Jones - SSC Editor (5/13/2011)


    Hugo Kornelis (5/13/2011)


    WHAAT???

    In the daily newsletter, the question specifies to "select 4". Which is what I did. And then I find that the site thinks I am wrong, because both "Extents may be owned by multiple objects" and "Extents may be owned by only one object" are correct.

    Unfortunately I cannot edit the question in the newsletter online, so I can only emphasize that you need to read it online.

    In terms of the may, the two statements are not opposite. They are in fact possibilities and both can be true. Extents may be owned by one object (uniform extent) and extents may be owned by multiple objects (mixed extent). Not the same extent, but different ones.

    I could not agree more. The QOTD asked if Exents can (or may) be owned by only one object. They can and may do that.

    It also asked if Extents Can (or may) they be owned by more than one object. That is also true.

    These statements only become exclusive if you explicitly state the type of extent in both statements.

    I believe the author wanted to enforce in us the learning that we have two types of Extents that are owned differantly. He has certainly suceeded at that. 😎

    Brandie is actually a girl... just saying. 😉

    LOL... see what happens why you read or write something without proper review. You even get things like He or She wrong...

  • SanDroid (5/13/2011)


    Ninja's_RGR'us (5/13/2011)


    SanDroid (5/13/2011)


    Steve Jones - SSC Editor (5/13/2011)


    Hugo Kornelis (5/13/2011)


    WHAAT???

    In the daily newsletter, the question specifies to "select 4". Which is what I did. And then I find that the site thinks I am wrong, because both "Extents may be owned by multiple objects" and "Extents may be owned by only one object" are correct.

    Unfortunately I cannot edit the question in the newsletter online, so I can only emphasize that you need to read it online.

    In terms of the may, the two statements are not opposite. They are in fact possibilities and both can be true. Extents may be owned by one object (uniform extent) and extents may be owned by multiple objects (mixed extent). Not the same extent, but different ones.

    I could not agree more. The QOTD asked if Exents can (or may) be owned by only one object. They can and may do that.

    It also asked if Extents Can (or may) they be owned by more than one object. That is also true.

    These statements only become exclusive if you explicitly state the type of extent in both statements.

    I believe the author wanted to enforce in us the learning that we have two types of Extents that are owned differantly. He has certainly suceeded at that. 😎

    Brandie is actually a girl... just saying. 😉

    LOL... see what happens why you read or write something without proper review. You even get things like He or She wrong...

    Well if Brandie is a guy "he" definitely his one of the better looking ones "out there" :Whistling:.

  • SanDroid (5/13/2011)


    Paul Randal (5/13/2011)


    Steve - I got this wrong because your wording is broken. Extents can NOT be owned by multiple objects. When an extent is a mixed extent, it is 'owned' by the allocation system - technically object ID 99. The individual pages are owned by multiple objects, but none of the objects own the extent.

    Paul! Please tell M$ for us that the BOL needs to be updated to show this... Currently it does not agree with you great statement

    To make its space allocation efficient, SQL Server does not allocate whole extents to tables with small amounts of data. SQL Server has two types of extents:

    Uniform extents are owned by a single object; all eight pages in the extent can only be used by the owning object.

    Mixed extents are shared by up to eight objects. Each of the eight pages in the extent can be owned by a different object.

    Shared ownership is not exclusive ownership.

    I am certain your statement is true.

    However, if 8 differant object id's own the data in the extent pages, don't 8 differant object_id own the extent as well?

    Well, it does. It says the extent is shared between them, not owned by them - as it explicitly says for uniform/dedicated extents.

    Paul Randal
    CEO, SQLskills.com: Check out SQLskills online training!
    Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
    SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
    Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005

  • Paul Randal (5/13/2011)


    Steve - I got this wrong because your wording is broken. Extents can NOT be owned by multiple objects. When an extent is a mixed extent, it is 'owned' by the allocation system - technically object ID 99. The individual pages are owned by multiple objects, but none of the objects own the extent.

    Don't blame Steve. That's my bad. I got the wording "owned by multiple objects" from an MS press book.

    Apparently the author knew about as much as I did about mixed extents. @=)

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Ninja's_RGR'us (5/13/2011)


    SanDroid (5/13/2011)


    Ninja's_RGR'us (5/13/2011)


    SanDroid (5/13/2011)


    I believe the author wanted to enforce in us the learning that we have two types of Extents that are owned differantly. He has certainly suceeded at that. 😎

    Brandie is actually a girl... just saying. 😉

    LOL... see what happens why you read or write something without proper review. You even get things like He or She wrong...

    Well if Brandie is a guy "he" definitely his one of the better looking ones "out there" :Whistling:.

    "I'm a lumberjack and I'm okay..."

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • cfradenburg (5/13/2011)


    Hugo Kornelis (5/13/2011)


    Again: WHAAT???

    I don't have the time right now to read the entire discussion....

    If you don't have time to read the entire discussion please don't go on a rant about what's going on is wrong. You don't have all the information.

    You are right, I should have read the entire discussion first.

    I have done so now, and I need to correct my original post. I made an incorrect assumption about what was changed.

    I have to change my assessment of the question. It was never a good question that was turned bad by the correction; it was a bad and faulty question and now is a bad and somewhat less faulty question.

    The correction is a good one. The possibility of overflow pages make it possible that non-LOB data still spans multiple pages. This was a mistake by Brandi.

    The "Extents may be owned by only one object" statement was obviously intended as it now is, which I really do not understand. This part of the question is not about knowledge of SQL Server, but about the ability to read in the mind of the author what she intended with a sentence that can be interpreted in different ways. And I still maintain that, given the context in the other answer options, the intended interpretation is NOT the most logical.

    Steve Jones - SSC Editor (5/13/2011)


    Comments encouraged on the changes.

    Okay, here we go.

    1. "Pages in an extents may be assigned to multiple objects" - changed again, I see, to incorporate Paul's feedback. Good, don't change (except for the grammatical oops: "an extents").

    2. "Rows can span multiple pages" - wasn't there something about excluding LOB in this answer? Removing that makes it much easier and fails to test the point the author intended. Change to "Rows with no LOB data types can span multiple pages".

    3. "Pages in extents may be assigned to only one object" - if you really want to keep this as a correct option, it needs significant rewording. Maybe "It is possible for an extent to have all its pages assigned to the same object". But I fail to see the point here, as this is already implied by the first statement. So I suggest marking this option as incorrect (bringing the required number of answers back to four) and rephrasing it as "Pages in an extent may not be assigned to multiple objects".

    4. "Data pages can be owned by multiple objects" - good, don't change.

    5. "Text data is stored on data pages" - I was happy with it, but after reading some of the other feedback given, maybe change this to "Data for the data type text is always stored on data pages".

    6. "Data pages can be owned by only one object" - good. Maybe for uniformity, if my suggestion for point 3 is taken, reword as "Data pages can not be owned by multiple objects".

    7. "A table row can be bigger than 8060 bytes if some of the datatypes are variable" - good. Actually, the part after "if" is not even required, but it might prevent new heated discussion. Technically, the term should be "variable length", though.


    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/

  • SQLkiwi (5/13/2011)

    Hi Nils,

    Just a small point on that: VARCHAR(MAX) is stored exactly as VARCHAR(8000), by default, including possibly moving to a ROW_OVERFLOW allocation unit, until the value stored exceeds 8000 bytes. It is then stored using the same layout as the deprecated text data type.

    The default behaviour of the LOB data types can be affected by the options 'text in row' and 'large value types out of row', which can be set using sp_tableoption.

    So, by default, a VARCHAR(MAX) column containing a single character would be stored IN_ROW, whereas a TEXT column containing the same single character would be stored in LOB_DATA.

    Thanks for the correction 🙂

  • I got it "right" because it said "select 5" by the time I got to it, and the 5 was enough to disambiguate the somewhat ambiguous English. (As Paul Randall pointed out, I actually got it wrong because that shared extent isn't owned by the things that share it, but by a different single object; so "select 5" gave me the wrong disambiguation :-)).

    The trouble with the verbs "can" and "may" in English arises when you have certain other words in the same clause; the most obvious one of those words is "only" ("not" is also a problem in some dialects: "can't" and "can not" in spoken English in some places in England mean two very different things, because that's the way the people in those places disambiguate the scope of that "not"). Expecting to get common understanding in an international community (even when all are native English speakers) when using "may" or "can" is optimism (and in a community where many are not native English speakers it's extreme optimism). So it is often better to stick to unabiguous things like "it is possible for an extent to have only one owner" and "it is possible for an extent to have multiple owners".

    I found the discussion interesting, because I learnt two new things about non-British English: (1) New Zealanders (or at least one of then) don't use the position in the clause of "only" to distinguish the three possible meanings that the combination of "only" with "may" can express in the same way the most British people do, and (2) that Dutchmen (on at least one of them) think that English "may" always means "may or may not" and can't be used unless "may not" and "may" are both true - in British English people commonly either say "may or may not" or put the verb into the subjunctive (might) if they want that meaning (although there's certainly no hard and fast rule) and I still haven't a clue what Americans do with that may...only combination (evidently not what Kiwis and Dutchmen do, but that still leaves plenty of scope for variation).

    Tom

  • Hugo Kornelis (5/13/2011)


    3. "Pages in extents may be assigned to only one object" - if you really want to keep this as a correct option, it needs significant rewording. Maybe "It is possible for an extent to have all its pages assigned to the same object". But I fail to see the point here, as this is already implied by the first statement.

    I can't agree with you on this one. "May" doesn't carry the implication that you attribute to it - at least in British English it certainly doesn't; Dutch English may be a different thing of course.

    Tom

  • Tom.Thomson (5/13/2011)


    that Dutchmen (on at least one of them) think that English "may" always means "may or may not" and can't be used unless "may not" and "may" are both true - in British English people commonly either say "may or may not" or put the verb into the subjunctive (might) if they want that meaning (although there's certainly no hard and fast rule) and I still haven't a clue what Americans do with that may...only combination (evidently not what Kiwis and Dutchmen do, but that still leaves plenty of scope for variation).

    Tom - I also think my first two wives and all children must be Dutch.

    "I May" always means "I may" or "I may not".

    Shhhh... Don't tell them I said that. I may get in trouble

    Seriously though, America alone is a centuries old melting pot of unique global and regional dialects. Dialects of a language born elsewhere.

    Is it statistically probable that we have any exact definition of how English is spoken or interpreted that works with Internet Blo0gging?

    IMHO: Blogging, discussion, etc... are how we determine what the masses get from our written word today. At least those of us not lucky enough to have authored a book lately.

  • SanDroid (5/13/2011)


    Seriously though, America alone is a centuries old melting pot of unique global and regional dialects. Dialects of a language born elsewhere.

    Is it statistically probable that we have any exact definition of how English is spoken or interpreted that works with Internet Blo0gging?

    IMHO: Blogging, discussion, etc... are how we determine what the masses get from our written word today. At least those of us not lucky enough to have authored a book lately.

    Yes, the USA had lots of input from lots of different languages; so it contributes a goodly chunk to the mixture of differnt varieties that English comes in.

    Statistically probable? I don't think statistics would be meaningful for that question. My own estimate is that it's an absolute certainty that we have no such definition.

    Tom

  • Steve Jones - SSC Editor (5/13/2011)


    I can't be responsible for sheep-reading and down under mis-interpreting the (other) colonist's English.

    😀 😎

    May implies it may or may not be true. It does not exclude the possibility that any particular object can be assigned to multiple objects.

    I think it depends on how it is read, and perhaps on how the target of the word 'only' is assessed, as Tom mentioned. In any case, I think it is fair to say that clearer wording would have helped avoid this rather technical issue arising at all.

    I'm with Hugo, for the most part.

  • Tom.Thomson (5/13/2011)


    (1) New Zealanders (or at least one of then) don't use the position in the clause of "only" to distinguish the three possible meanings that the combination of "only" with "may" can express in the same way the most British people do...

    I can't speak for all four million of us, but I had to choose between two interpretations:

    "Pages in extents may be assigned to only one object"

    1) "Pages in extents might (all) be assigned to a single object" (an observation)

    or...if we are used to reading technical specifications and the like, perhaps as:

    2) "You can only assign pages from an extent to the same single object" (an instruction).

  • Steve Jones - SSC Editor (5/13/2011)


    SQLkiwi (5/13/2011)


    Steve Jones - SSC Editor (5/13/2011)


    Comments encouraged on the changes.

    "Extents may be owned by only one object".

    This still reads (to me) as excluding the possibility that an extent may be owned by more than one object 😉

    "Rows can span multiple pages (excluding LOB data)"

    I didn't read it this way originally, but it's possible to read that as saying that LOB data cannot span multiple pages.

    Who'd be a QotD author/SSC editor? :laugh:

    I can't be responsible for sheep-reading and down under mis-interpreting the (other) colonist's English. May implies it may or may not be true. It does not exclude the possibility that any particular object can be assigned to multiple objects.

    Steve,

    If you lookup may in a dictionary you will notice that item 4 is: "shall, must —used in law where the sense, purpose, or policy requires this interpretation."

    So it is perfectly reasonable to read that as saying that the pages in an extent can only be assigned to a single object. (Which is how I read it.)

    You have to love our language, the same wording can mean multiple things, which sure doesn't make tests/questions easy to write. (And I have a fair amount of experience working with analysis and reporting on the validity and reliability of questions on a test from a prior life. In our case new questions were never counted in the score of the test taker until we had enough data to verify that the question was actually working, so it took almost a year before a new question could be put into production.)

Viewing 15 posts - 61 through 75 (of 84 total)

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