Re: storage size of a long datatype

From: Lawrence James <James.Lawrence_at_epamail.epa.gov>
Date: Tue, 29 Nov 1994 09:13:32 GMT
Message-ID: <James.Lawrence.29.00093A0C_at_epamail.epa.gov>


In article <stauffer-1611941624270001_at_stauffer.swarthmore.edu> stauffer_at_cc.swarthmore.edu (Glenn Stauffer) writes:
>From: stauffer_at_cc.swarthmore.edu (Glenn Stauffer)
>Subject: storage size of a long datatype
>Date: Wed, 16 Nov 1994 16:24:27 -0500
 

>I am running a script to estimate average row length on several Oracle
>data tables. The script to calculate the size of a column looks like
>this:
 

> nvl(vsize(column_name),0)+1
 

>This calculation fails when applied against a column defined to be
>datatype long.
 

>How would I calculate the byte size of a long data column?
 

>Thanks.
 

>Glenn Stauffer
>Swarthmore College DBA

You could determine what is left in the block after subtracting the block overhead and the space used by all the rest of the columns in the rows in that block. Unfortunately you would also have to be prepared to deal with chained blocks if the long is very big and I'm not sure how you would figure that in but believe there is a way.

I usually recommend that longs be placed in another table with just a sequence number as the key. Now that the character data type goes up to 2000 anything that needs a long is going to be pretty good sized and it will kill you when you do full table scans. Sizing is also easier since you can just load some test data and see how many blocks it took.

Lawrence.... Received on Tue Nov 29 1994 - 10:13:32 CET

Original text of this message