Re: Calculating avail/empty rows in extents.
Posted in 1999
Topics: Storage & Space Management, Data Types & Schema Design
Don't forget that 255 rows is the max that will fit on a page. So take
the MIN of 255, and Formula below...
Darin Tracy
"Art S. Kagel" wrote:
> Russell Bierschbach wrote:
> >
> > How can I calculate the number of rows that can be inserted into a table
> > before another extent is automatically added? Also, is there anything to
> > keep in mind when calculating for fragmented tables? I'm using Informix
> > Dynamic Server 7.30.UC7 on HP/UX 10.20, and HP/UX 11.0.
>
> Use oncheck -pT to determine how many unused and partially used data
> pages there are within the existing extents, then calculate the rowsize
> (or get it from dbschema) and ddivide 2020 by (rowsize + 4) to
> determine the number of rows per page (you will get a few more if your
> table contains varchar columns which are less than max length on
> average, if so you can adjust the rowsize to the actual average rowsize
> rather than the max size dbschema uses). Now multiply the average or
> actual number of rows per page by the number of unused pages and 1/3 of
> the number of partial pages and there is your best estimate.
>
> Art S. Kagel
Darin Tracy wrote:
>
> Don't forget that 255 rows is the max that will fit on a page. So take
> the MIN of 255, and Formula below...
True but you can only have room for >255 rows with a table which only
has <=3 bytes per row not a realistic table. Thanks for keeping me
honest though.
Art S. Kagel
> "Art S. Kagel" wrote:
>
> > Russell Bierschbach wrote:
> > >
> > > How can I calculate the number of rows that can be inserted into a table
> > > before another extent is automatically added? Also, is there anything to
> > > keep in mind when calculating for fragmented tables? I'm using Informix
> > > Dynamic Server 7.30.UC7 on HP/UX 10.20, and HP/UX 11.0.
> >
> > Use oncheck -pT to determine how many unused and partially used data
> > pages there are within the existing extents, then calculate the rowsize
> > (or get it from dbschema) and ddivide 2020 by (rowsize + 4) to
> > determine the number of rows per page (you will get a few more if your
> > table contains varchar columns which are less than max length on
> > average, if so you can adjust the rowsize to the actual average rowsize
> > rather than the max size dbschema uses). Now multiply the average or
> > actual number of rows per page by the number of unused pages and 1/3 of
> > the number of partial pages and there is your best estimate.
> >
> > Art S. Kagel