Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1

    Unanswered: how many bytes i need to store in the database?

    Hi colleagues,
    I need to create an index in db2 v8, O.S. 5.3, i like know how many bytes need the database for store decimal(11,0) for create this index?

    Thank you for advanced.
    DBA DB2 for LUW

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    It depends:

    IBM DB2 10.1 Information Center for Linux, UNIX, and Windows

    I know it is for V10.1 but it should give you an idea.

    Andy

  3. #3
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    If you have Control-Centre, it is able to estimate index-size.
    If you run db2advis on a query for which it would recommend the new-index , then db2advis output will also show you the expected size of that index.

  4. #4
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Thank you for you help colleagues,
    I don'n have none graphics tool, i need this for know how many space i
    need in tablespace where is allocated this index.
    Thank you.
    DBA DB2 for LUW

  5. #5
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    db2advis is a command-line (text only) tool .
    Read about it in the V8 infocenter on-line.
    If you know an SQL query for which the index on this decimal column might be used, then db2advis will advise the size of the index on that column.

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    The Decimal (11,0) takes 6 bytes, plus one byte if the column in nullable. Then you need space for the RID (Row ID) and you can look up the RID size in the DB2 V8 doc (may be different in V9+). Figure about 10% freespace (default) and more (due to page splits) if you don't reorg index often.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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