@
@ Name: VnodeCalc.txt
@
@ Purpose: Calculate storage savings for variable length node
@
@ Usage: use/x VnodeCalc.txt <table-name> <key-name>
@
@ Sample Output:
@
@ Optimum storage requirement (for .ttt file) ...
@ variable length node: 122,320,614 MB
@ fixed length node: 179,200,000 MB
@ Savings: 56,879,386 MB
@ SavingsPC: 32 %
@
reset/x
unset/x
uncalc/x
set %table = '{%1}'
set %column = '{%2}'
calc %nodeOH = 24
calc %vnodeOH = 4
verify/x signature {%table} {%column} length
calc %fxLen = int((%answer2+1)/2) *2
createtemptable TT1 "data base name is TT1 // -
DG "TT1" AS TX1 100000 records temp grow // -
"TT1"."Length" as TX1C1 ID //"
fill/x a {%table}
sort/r/x a {%table} {%column}
clear/s/x a {%table}
return a {%table} "return // -
calc %len = strlen(trim({%column})) // -
calc %len = int((%len+1)/2) * 2 // -
write tt1 length = %len //"
fill/x b tt1
sort/x b tt1 length
return/x b tt1 "return // -
every length // -
calc %size = (length+ %nodeOH + %VnodeOH) * length[c] // -
calc %tsize = %tsize + %size // -
atend // -
calc %fxSize = (%fxLen + %nodeOH) * length[c] // -
calc %savings = %fxSize - %tsize // -
calc %savingsPC = %savings * 100 / %fxSize // -
print ' ' // -
print 'Optimum storage requirement (for .ttt file) ...' // -
print ' variable length node:' %tsize (+,15.0) 'MB' // -
print ' fixed length node:' %fxsize (+,15.0) 'MB' // -
print ' Savings:' %savings (+,15.0) 'MB' // -
print ' Savings:' %savingsPC (+,15.0) '%' // -
r_initial // -
calc %tsize = 0 //
reset/x
unset/x
uncalc/x
Copyright © 2019 , WhamTech, Inc. All rights reserved. This
document is provided for information purposes only and the contents hereof are
subject to change without notice. Names may be
trademarks of their respective owners.