7 messages in com.mysql.lists.mysqlRe: Figuring out the space.
FromSent OnAttachments
Ariel Manzur10 Aug 2000 23:00 
Ariel Manzur11 Aug 2000 04:46 
Ariel Manzur11 Aug 2000 06:48 
Dana Powers11 Aug 2000 10:26 
Robert Goff11 Aug 2000 11:19 
Dana Powers11 Aug 2000 14:11 
Dana Powers11 Aug 2000 15:17 
Subject:Re: Figuring out the space.
From:Dana Powers (dana@quicknet.net)
Date:08/11/2000 03:17:35 PM
List:com.mysql.lists.mysql

On Fri, 11 Aug 2000, Ariel Manzur wrote:

At 14:11 11/08/2000 -0700, Dana Powers wrote:

On Fri, 11 Aug 2000, Ariel Manzur wrote:

Hi.. thanks.. thats really useful.. I have some questions:

Does it only work with text files? I have some varchar fields too.. and, can I put more than 1 field name into SUM() or LENGTH()?

LENGTH() is a string function, but the idea is that a character is generally 1 byte, so a string of 4 characters is 4 bytes. Of course this is not entirely accurate (as I said), but you can play around with it and see where it gets

Why is it not accurate? I found the description of the functions on the mysql manual (thanks for the link :), and length sound accurate..

It isnt accurate because you make the assumption that a string that is 4 characters long takes 4 bytes to store. This may not always be true (I dont know). I do know that any variable length field will most likely have an extra X bytes to store the length of the field. This is an extra overhead that you wont be accounting for, although you could say SUM(LENGTH(str1)+X). Similar to the file v. inode quotas for filesystems, but not really.

Dana