The following steps are used to calculate page-count for the DISPLACEMENT parameter of the CREATE INDEX statement:
Set N = #-of-rows
High-level-SR8s = 0
Bottom-level-SR8s = 1
Repeat
N = (N + IBC-key-count - 1) / IBC-key-count (truncate)
If N = 1, exit
If High-level-SR8s = 0,
High-level-SR8s = 1
Bottom-level-SR8s = N
Else High-level-SR8s = High-level-SR8s + N
Set Total-SR8s = High-level-SR8s + Bottom-level-SR8s
SR8-size = 32 + (IBC-key-count + 2) * (Key-length + 8)
(Page-size - Page-reserve - 32) / (SR8-size + 8)
(High-level-SR8s + SR8s-per-page - 1)
------------------------------------- + 1 (truncate)
SR8s-per-page
If the calculated displacement is greater than the number of pages in the area containing the index, then:
Displacement-page-count = Number-of-pages-in-area / 2
Table displacement is the number of pages that the rows of a table are displaced from the index around which they are clustered. The table displacement is 0 if the table and index reside in different areas. It is calculated as described below if they reside in the same area:
(Total-SR8s + SR8s-per-page - 1)
------------------------------------- + 1 (truncate)
SR8s-per-page
If the calculated displacement is greater than the number of pages in the area containing the index, then:
Table-displacement = Number-of-pages-in-area * 3 / 4
|
Copyright © 2014 CA.
All rights reserved.
|
|