Re: determining how many bytes a mysql row or table is consuming

From: Date: Thu, 08 Nov 2001 06:17:44 +0000
Subject: Re: determining how many bytes a mysql row or table is consuming
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-73839@lists.php.net to get a copy of this message
On Thu, 8 Nov 2001 16:39, Justin French wrote: > Hi, > > I'm interested in determining the bytes consumed by rows or entire > tables... we have a (large) table of application forms which users can > SAVE to submit to us at a later date... the problem is cleaning out > those which consume space and never come back to complete. > > So, i'd be wanting to find the diskspace consumed by certain rows (eg > WHERE status='saved' or WHERE folder='trash'). > > Any ideas? Only thing I can think of is to jion all the fields > together into one string and determin it's length, but i'm sure there's > gotta be an easy way. > > Note: This doesn't have to be incredibly accurate either... if it was > 80% acurate, this would be sufficient. > > TIA > > Justin French For that degree of(in)accuracy, perhaps you could get away with doing some arithemtic on the output of mysql_field_type, which gives you amongst other things field type, name and length. Alternatively, mysql_fetch_lengths may be an option. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Meow... SPLAT... Ruff... SPLAT... (Raining cats & dogs)

« previous php.general (#73839) next »