Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2004
    Posts
    193

    Unanswered: The significance of "1024" in SQL Server?

    Sorry for the basic question but what is the significance of 1024? Is this true in Oracle as well? Is it a Fibonacci number?(just kidding). But why is the limit 1024 as far as fields in a table or 1024 arguements in a stored procedure, etc? Thanks in advance for adding to the "nuts and bolts" of my knowledge.

    ddave

  2. #2
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    No Idea! But if I had to take a wild guess for the number of columns I'm guessing it has to do with the NULL bitmap (1 bit for each column, 1 meaning the value is NULL) in the row structure on a page.

    Although the number of columns is stored in 2 bytes, the NULL bitmap is one bit for each column. 1024 columns makes a NULL bitmap of 128 bytes. Maybe that's the limit.

    Again this is pure speculation and if anyone knows for sure, please let us know

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    it's because 512 wasn't enough, but 2048 was too many.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by jezemine
    it's because 512 wasn't enough, but 2048 was too many.
    ...basically, yeah. 1024 is 2 raised to the tenth power, and so can be stored in 10 bits of space. You will frequently find computer constants and limits that are powers of 2.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    Quote Originally Posted by blindman
    You will frequently find computer constants and limits that are powers of 2.
    That's true but 2^10 is a bit weird because mostly it's 2^8, 2^16, etc. For instance in a row the number of columns is stored in 2 bytes, which means it can potentionaly hold 2^16 columns.

  6. #6
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    There may be a few "status bits" tossed in there, which would rob them of 6 bits. Somewhat similar to the page header and footer leaving you with 8060 bytes on your 8192 byte page.

  7. #7
    Join Date
    Feb 2004
    Posts
    193
    As Blindman alluded to Wikipedia (and I know you have to question what's on Wikipedia sometimes) says it is more of an industry wide issue than a database issue.

    from http://en.wikipedia.org/wiki/1024_%28number%29

    "In binary notation, 1024 is represented as 10000000000, making it a simple "round number" occurring frequently in computer applications."

  8. #8
    Join Date
    Feb 2004
    Posts
    193
    .....and I forgot to mention since I read this on Wikipedia, I believe it because "I believe everything I read", lol.

    ddave

  9. #9
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    Quote Originally Posted by Wikipedia
    1024 is the natural number following 1023 and preceding 1025.
    Well, you learn something new everyday

  10. #10
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    yea, i can never remember what comes after 1023! thank goodness for wikipedia.

  11. #11
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by dolfandave
    As Blindman alluded to Wikipedia (and I know you have to question what's on Wikipedia sometimes) says it is more of an industry wide issue than a database issue.

    from http://en.wikipedia.org/wiki/1024_%28number%29

    "In binary notation, 1024 is represented as 10000000000, making it a simple "round number" occurring frequently in computer applications."
    That sounds bogus to me. Because in binary, 2 is also a round number (10), as is 4 (100), 8 (1000), 512 (1000000000), and 2048 (100000000000), etc....so it still begs the question "Why 1024 and not 512 or 2048?", which Jezemine has so elegantly answered.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  12. #12
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    i'm blushing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •