Calculate Index Size problems

Ask a Question related to Informix, Design and Development.

  1. #1

    Default Calculate Index Size problems



    Hi,

    I'm trying to calculate the number of pages a index takes up, but keep
    coming up short. The table I'm woring with was just created (i also altered
    it to cluster),


    oncheck output


    TBLspace Report for test:pen.acc_bal

    Physical Address a009a4
    Creation date 07/11/03 09:50:05
    TBLspace Flags 801 Page Locking
    TBLspace use 4 bit bit-maps
    Maximum row size 71
    Number of special columns 0
    Number of keys 1
    Number of extents 2
    Current serial value 1
    First extent size 8
    Next extent size 8
    Number of pages allocated 2120
    Number of pages used 2117
    Number of data pages 1827
    Number of rows 98619
    Partition partnum 5243161
    Partition lockid 5243161


    Extents
    Logical Page Physical Page Size
    0 a250af 1280
    1280 a255b7 840

    TBLspace Usage Report for test:pen.acc_bal


    Type Pages Empty Semi-Full Full Very-Full
    ---------------- ---------- ---------- ---------- ---------- ----------
    Free 5
    Bit-Map 1
    Index 287
    Data (Home) 1827
    ----------
    Total Pages 2120

    Unused Space Summary

    Unused data slots 39
    Unused bytes per data page 18
    Total unused bytes in data pages 32886


    Home Data Page Version Summary

    Version Count

    0 (current) 1827

    Index Usage Report for index accbal_idx on test:pen.acc_bal


    Average Average
    Level Total No. Keys Free Bytes
    ----- -------- -------- ----------
    1 1 286 1084
    2 286 344 1827
    ----- -------- -------- ----------
    Total 287 344 1824

    I have used the following to calculate the index size

    1.. Key value = (SUM(columns) + 4) * 1.5
    2.. propunique = nrows / nunique
    3.. entry size =(length of row pointer * average number of rows per unique
    index) + key value
    4.. # of index entries per page = 4068 / entry size
    5.. Estimated # of leave pages = # of index entries per page / nunique
    6.. Add 5 percent for branch and root nodes

    1.. (SUM(4)+4)*1.5 = 12
    2.. 98619 / 18359 = 5.37 -- got nunique from sysindexes
    3.. (5 * 5.37) + 12 = 38.85
    4.. 4068 / 38.85 = 104.71
    5.. 18359 / 105 = 174
    6.. 174 * 1.5 = 183

    183 is quite off from onchecks 287. Can anyone point me in the right
    direction?

    Thank you



    J


    Jay Guest

  2. Similar Questions and Discussions

    1. z-index problems in IE6
      i managed to get IE6 to use z-indexes and layer properly.. everything that is except form elements specifically combo boxes appear above my dropdown...
    2. Index size - 4.0 vs 5.0
      Our databases total 4.3GB (data) and 1.9GB (index) on 4.0.13 I have set-up a new server with 5.0.24 and loaded the exact same data. The datasize...
    3. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
      Hey Folks,(New to .NET) This is driving me NUTZ... If anyone out there can resolve this from me I would greatly appreciate it... Line 238: Line...
    4. Problems generating index
      Did you ever get this to work. I am having a similar problem. Dana
    5. Creating an index for a variable size opaque type
      I have an opaque type like this: create opaque type AsnOctetString( internallength = variable, maxlen = 4096, alignment = 4 ); I may NOT be...
  3. #2

    Default Re: Calculate Index Size problems


    "Jay" <remove:jay@td.ca> wrote in message
    news:X_zPa.9672$ru2.1027767@news20.bellglobal.com. ..
    >
    >
    > Hi,
    >
    > I'm trying to calculate the number of pages a index takes up, but keep
    > coming up short. The table I'm woring with was just created (i also
    altered
    > it to cluster),
    >
    >
    > oncheck output
    >
    >
    > TBLspace Report for test:pen.acc_bal
    >
    > Physical Address a009a4
    > Creation date 07/11/03 09:50:05
    > TBLspace Flags 801 Page Locking
    > TBLspace use 4 bit bit-maps
    > Maximum row size 71
    > Number of special columns 0
    > Number of keys 1
    > Number of extents 2
    > Current serial value 1
    > First extent size 8
    > Next extent size 8
    > Number of pages allocated 2120
    > Number of pages used 2117
    > Number of data pages 1827
    > Number of rows 98619
    > Partition partnum 5243161
    > Partition lockid 5243161
    >
    >
    > Extents
    > Logical Page Physical Page Size
    > 0 a250af 1280
    > 1280 a255b7 840
    >
    > TBLspace Usage Report for test:pen.acc_bal
    >
    >
    > Type Pages Empty Semi-Full Full
    Very-Full
    > ---------------- ---------- ---------- ---------- ---------- ---------
    -
    > Free 5
    > Bit-Map 1
    > Index 287
    > Data (Home) 1827
    > ----------
    > Total Pages 2120
    >
    > Unused Space Summary
    >
    > Unused data slots 39
    > Unused bytes per data page 18
    > Total unused bytes in data pages 32886
    >
    >
    > Home Data Page Version Summary
    >
    > Version Count
    >
    > 0 (current) 1827
    >
    > Index Usage Report for index accbal_idx on test:pen.acc_bal
    >
    >
    > Average Average
    > Level Total No. Keys Free Bytes
    > ----- -------- -------- ----------
    > 1 1 286 1084
    > 2 286 344 1827
    > ----- -------- -------- ----------
    > Total 287 344 1824
    >
    > I have used the following to calculate the index size
    >
    > 1.. Key value = (SUM(columns) + 4) * 1.5
    > 2.. propunique = nrows / nunique
    > 3.. entry size =(length of row pointer * average number of rows per
    unique
    > index) + key value
    > 4.. # of index entries per page = 4068 / entry size
    > 5.. Estimated # of leave pages = # of index entries per page / nunique
    > 6.. Add 5 percent for branch and root nodes
    >
    > 1.. (SUM(4)+4)*1.5 = 12
    > 2.. 98619 / 18359 = 5.37 -- got nunique from sysindexes
    > 3.. (5 * 5.37) + 12 = 38.85
    > 4.. 4068 / 38.85 = 104.71
    > 5.. 18359 / 105 = 174
    > 6.. 174 * 1.5 = 183
    >
    > 183 is quite off from onchecks 287. Can anyone point me in the right
    > direction?
    >
    > Thank you
    >
    >
    >
    > J

    Oops, i made a mistake in step 2, should have been the other way around.
    Still get a wrong number of 331 pages though.


    Jay Guest

  4. #3

    Default Re: Calculate Index Size problems

    I don't mean to be unhelpful - because, straight up, I don't know the
    answer.
    But I'm really interested to know why anyone ever bothers to do this.

    I can remember in every DBMS course I've ever done we've done endless
    tedious space calculation exercises. And never used it - not since the
    invention of disks bigger than 512M anyway.

    Just guess and then triple it - that's my advice!

    "Jay" <remove:jay@td.ca> wrote in message
    news:X_zPa.9672$ru2.1027767@news20.bellglobal.com. ..
    >
    >
    > Hi,
    >
    > I'm trying to calculate the number of pages a index takes up, but keep
    > coming up short. The table I'm woring with was just created (i also
    altered
    > it to cluster),
    >
    >
    > oncheck output
    >
    >
    > TBLspace Report for test:pen.acc_bal
    >
    > Physical Address a009a4
    > Creation date 07/11/03 09:50:05
    > TBLspace Flags 801 Page Locking
    > TBLspace use 4 bit bit-maps
    > Maximum row size 71
    > Number of special columns 0
    > Number of keys 1
    > Number of extents 2
    > Current serial value 1
    > First extent size 8
    > Next extent size 8
    > Number of pages allocated 2120
    > Number of pages used 2117
    > Number of data pages 1827
    > Number of rows 98619
    > Partition partnum 5243161
    > Partition lockid 5243161
    >
    >
    > Extents
    > Logical Page Physical Page Size
    > 0 a250af 1280
    > 1280 a255b7 840
    >
    > TBLspace Usage Report for test:pen.acc_bal
    >
    >
    > Type Pages Empty Semi-Full Full
    Very-Full
    > ---------------- ---------- ---------- ---------- ---------- ---------
    -
    > Free 5
    > Bit-Map 1
    > Index 287
    > Data (Home) 1827
    > ----------
    > Total Pages 2120
    >
    > Unused Space Summary
    >
    > Unused data slots 39
    > Unused bytes per data page 18
    > Total unused bytes in data pages 32886
    >
    >
    > Home Data Page Version Summary
    >
    > Version Count
    >
    > 0 (current) 1827
    >
    > Index Usage Report for index accbal_idx on test:pen.acc_bal
    >
    >
    > Average Average
    > Level Total No. Keys Free Bytes
    > ----- -------- -------- ----------
    > 1 1 286 1084
    > 2 286 344 1827
    > ----- -------- -------- ----------
    > Total 287 344 1824
    >
    > I have used the following to calculate the index size
    >
    > 1.. Key value = (SUM(columns) + 4) * 1.5
    > 2.. propunique = nrows / nunique
    > 3.. entry size =(length of row pointer * average number of rows per
    unique
    > index) + key value
    > 4.. # of index entries per page = 4068 / entry size
    > 5.. Estimated # of leave pages = # of index entries per page / nunique
    > 6.. Add 5 percent for branch and root nodes
    >
    > 1.. (SUM(4)+4)*1.5 = 12
    > 2.. 98619 / 18359 = 5.37 -- got nunique from sysindexes
    > 3.. (5 * 5.37) + 12 = 38.85
    > 4.. 4068 / 38.85 = 104.71
    > 5.. 18359 / 105 = 174
    > 6.. 174 * 1.5 = 183
    >
    > 183 is quite off from onchecks 287. Can anyone point me in the right
    > direction?
    >
    > Thank you
    >
    >
    >
    > J
    >
    >

    Neil Truby Guest

  5. #4

    Default Re: Calculate Index Size problems


    "Neil Truby" <neil.truby@ardenta.com> wrote in message
    news:bems0s$6ukns$1@ID-162943.news.uni-berlin.de...
    > I don't mean to be unhelpful - because, straight up, I don't know the
    > answer.
    > But I'm really interested to know why anyone ever bothers to do this.
    >
    > I can remember in every DBMS course I've ever done we've done endless
    > tedious space calculation exercises. And never used it - not since the
    > invention of disks bigger than 512M anyway.
    >
    > Just guess and then triple it - that's my advice!
    >
    Hi Neil,

    The reason why I am trying to calculate the index size is because one of our
    production servers has serious extent interleaving. I am planning to unload
    / load all databases within the instance, and include extent sizing. I need
    to know how much disk space to expect after the extent allocation. Becuase
    these databases have never been rebuilt, I expect there will be space to be
    reclaimed after the unload / load. I just want to know how much space will
    be reclaimed (becuase of the unload / load) or additional space to be taken
    up after the NEXT EXTENT kicks in (since I only have 6 gigs left).



    Jay Guest

  6. #5

    Default Re: Calculate Index Size problems


    "Jay" <remove:jay@td.ca> wrote in message
    news:AdDPa.9770$ru2.1056797@news20.bellglobal.com. ..
    >
    > The reason why I am trying to calculate the index size is because one of
    our
    > production servers has serious extent interleaving. I am planning to
    unload
    > / load all databases within the instance, and include extent sizing. I
    need
    > to know how much disk space to expect after the extent allocation.
    Becuase
    > these databases have never been rebuilt, I expect there will be space to
    be
    > reclaimed after the unload / load. I just want to know how much space
    will
    > be reclaimed (becuase of the unload / load) or additional space to be
    taken
    > up after the NEXT EXTENT kicks in (since I only have 6 gigs left).
    >
    unload the table to a text file and rebuild it on a test server. Then you
    get the exact size.

    >
    >

    David Williams Guest

  7. #6

    Default Re: Calculate Index Size problems


    "David Williams" <djw@smooth1.fsnet.co.uk> wrote in message
    news:benncu$iad$1@newsg4.svr.pol.co.uk...
    >
    > "Jay" <remove:jay@td.ca> wrote in message
    > news:AdDPa.9770$ru2.1056797@news20.bellglobal.com. ..
    > >
    >
    > > The reason why I am trying to calculate the index size is because one of
    > our
    > > production servers has serious extent interleaving. I am planning to
    > unload
    > > / load all databases within the instance, and include extent sizing. I
    > need
    > > to know how much disk space to expect after the extent allocation.
    > Becuase
    > > these databases have never been rebuilt, I expect there will be space to
    > be
    > > reclaimed after the unload / load. I just want to know how much space
    > will
    > > be reclaimed (becuase of the unload / load) or additional space to be
    > taken
    > > up after the NEXT EXTENT kicks in (since I only have 6 gigs left).
    > >
    >
    > unload the table to a text file and rebuild it on a test server. Then
    you
    > get the exact size.
    I was hoping that someone would help me correct my calculation. Rebuilding
    250 tables in 10 databases is not feasible, a simple query and calculation
    (like how the table size ca be calculated entries/(4068/(rowsize+4)) would
    be much more helpful. Can anyone help?


    Jay Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139