Row Sizes - can it be done?
Posted in 1999
Topics: Data Types & Schema Design
Hello All,
I need to be able to find out the physical size (bytes or otherwise) of a
particular row in a table. We are using IUS 9.14.UC5.
Example:
CREATE TABLE sizetest
(
client varchar(10) NOT NULL,
imagecode varchar(10),
imagedesc varchar(100),
image blob,
PRIMARY KEY (client, imagecode)
);
A client can have multiple entries on this table.
I want to be able to calculate the physical amount of space a particular
client has used within this table.
Can it be done?
Regards,
---
Steven Livanes
stevenNOSPAM@diggy.com.au
Diggy Internet Services
http://www.diggy.com.au
SELECT client,
((length(client) + 1) + -- 1 Byte overhead per varchar
(length(imagecode) + 1) +
(length(imagedesc) + 1) +
(length(image) + 56)) row_length -- 56 bytes overhead per BLOB column
FROM sizetest
WHERE client = "MyClient";
Art S. Kagel
Steven Livanes wrote:
>
> Hello All,
>
> I need to be able to find out the physical size (bytes or otherwise) of a
> particular row in a table. We are using IUS 9.14.UC5.
>
> Example:
>
> CREATE TABLE sizetest
> (
> client varchar(10) NOT NULL,
> imagecode varchar(10),
> imagedesc varchar(100),
> image blob,
> PRIMARY KEY (client, imagecode)
> );>
> A client can have multiple entries on this table.
>
> I want to be able to calculate the physical amount of space a particular
> client has used within this table.
>
> Can it be done?
>
> Regards,
> ---
> Steven Livanes
> stevenNOSPAM@diggy.com.au
> Diggy Internet Services
> http://www.diggy.com.au