Database
Highlighted

## Block Size equation

Hi

I am using this equation for predicting table growth. I am unsure how to use the roundup function described in the database design document. I have the values from DBS control.

Typical block size = ROUNDUP(MAX x 3/4, 512)

since in our environment we dont have DATABLOCKSIZE, i am using PERMDBSize which is 1024 sectors. I figured using the example for 15.10 database design document that 1 sector is 512 bytes so 1024 sectors is 524,288 bytes. If i plugin the values into the equation, I am unsure of the ROUNDUP function, does work like ROUND function in Teradata?

Typical block size = ROUNDUP(524288 x 3/4, 512)

Am I wrong all together?

Thanks,

Bijo

Accepted Solutions

## Re: Block Size equation

Since the MAX value 524,288 was a multiple of 2048 (512*4), the result of the division by 512 is an integer and ROUNDUP makes no difference for this case.

On the other hand, suppose your MAX were 523,776.

Then 3/4 of that would be 392,832 and dividing by 512 yields 767.25

In that case, CEILING returns 768 and the final answer would be 393,216 (not 392,832).

1 ACCEPTED SOLUTION
3 REPLIES 3

## Re: Block Size equation

ROUNDUP(x,y)  = CEILING(x/y)*y

This formula approximates the logical block size. If you have block-level compression enabled, then physical blocks will be smaller.

## Re: Block Size equation

but I am left with 'x' value if I plugin the values at the end that doesnt make sense to me.

CEILING(393216/512)*512

CEILING(768)*512 = 393216 bytes

## Re: Block Size equation

Since the MAX value 524,288 was a multiple of 2048 (512*4), the result of the division by 512 is an integer and ROUNDUP makes no difference for this case.

On the other hand, suppose your MAX were 523,776.

Then 3/4 of that would be 392,832 and dividing by 512 yields 767.25

In that case, CEILING returns 768 and the final answer would be 393,216 (not 392,832).