|
| Re: ROW SIZE???? [message #3399 is a reply to message #3396 ] |
Sun, 10 August 2008 09:29   |
Speeple Messages: 91 Registered: August 2006 |
Member |
|
|
I'm not quite sure what you're asking?
Do you want to amount of RAM used to allocate the result set?
Do you want the specific data size of the columns (not including other overheads)?
For the latter:
SELECT LENGTH(name) + LENGTH(details) + 4 AS size FROM example WHERE id=1;
LENGTH() returns the byte length of the columns, the +4 is for the numberical INT type.
To calculate for more than one row:
SELECT SUM(LENGTH(name) + LENGTH(details) + 4) FROM example WHERE id=1;
Martin Gallagher | Speeple: The latest news
|
|
|
|
| Re: ROW SIZE???? [message #3402 is a reply to message #3396 ] |
Sun, 10 August 2008 09:57  |
Speeple Messages: 91 Registered: August 2006 |
Member |
|
|
If you're treating numberical data types as natives then INT is 4 bytes.
If you need to treat as string then again use LENGTH(id)
Native sizes per column:
INT: 4 bytes
MEDIUMINT: 3 bytes
SMALLINT: 2 bytes
TINYINT: 1 bytes
I don't know what application you are developing so I don't know if you need to include overheads.
You can show table information to display average row length.
Martin Gallagher | Speeple: The latest news
|
|
|