TBCHECKs
Posted in 1996
> > Also, does anyone have any quick and dirty tools to calculate extent > sizes for tables. I wondered if there was anything out there where you > could plug in number of rows, page sizes, indexes etc....and have it > calculate the first/next extent size. This is for Informix 5.0 > > I've done calculations on 7.1 databases the long way but figured someone > should have a tool out by now. tbcheck -pe|grep $tabname|grep -v WARNING|awk 'BEGIN{a=0} {a+=$3} END{print a}' works for me. Doh. That's not what you wanted (but I'll leave it in anyway). How about: Note - this is an old calculation and I wonder if it ever was valid. Also note 'gf' is a growth factor - set here to 1.5 times the size. Also note the pgsz (page size) is set to (2048). # # awk -f calcsize.awk < syscatalog.output # # to get syscatalog.output do: select nrows, rowsize, nindexes, tabname # from systables # where tabid > 99 # BEGIN { FS="|" gf=1.5 pgsz=2048 } { nr=$1 rs=$2 ni=$3 ts=gf*nr*(rs + 9 + 2024%(rs+4) + (10*ni)) ext=ts/pgsz printf("%s %5d %8d\\n", $4, ts, ext) } cheers j. ________________________________________________________________________ Jack Parker - Hewlett Packard, DMD/IS Boise, Idaho, USA jparker@boi.hp.com Currently on loan to PLD/PE ________________________________________________________________________ Outside of a dog a book is a man's best friend. Inside of a dog it's too dark to read. (Groucho Marx) ________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. ________________________________________________________________________