Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate row size?

Status
Not open for further replies.

twifosp

Programmer
Jul 25, 2003
186
US
SHOW TABLE STATUS FROM your_db_name [like 'tabe_name']

Will give me average row sizes, but let's say I needed an exact size for each row. What would be the method to select the size of a specific row?
 
here's one way:

SELECT * FROM daTable

and count the bytes in your application code

:)

alternatively, you could develop a formula based on the specific columns in your table, and calculate 1 byte for TINYINTs, 2 bytes for SMALLINTs, 4 bytes for INTEGERS, 8 bytes for BIGINTs, LENGTH() for CHARS and VARCHARS, eck settera, eck settera...

SELECT formula FROM daTable

:)

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top