"Martin B. Jespersen" wrote:
> I have a couple of questions:
> I have a sun enterprise 250 with dual ultrasparc 250Mhz and 256MB ram,
> I am running apache/php/mysql on it and i need to optimize the baby to run as
> fast as possible.
> I have compiled mysql with -static but i am not sure what options i should set
> for mysqld
> here is how my /etc/my.cnf looks:
> set-variable = key_buffer=16M
> set-variable = table_cache=128
> set-variable = sort_buffer=4M
> set-variable = record_buffer=1M
> I am in doubt if i should increase/decrease these numbers and how much.
Optimisation depends on your data and your queries!
I would increase key_buffer first (e.g. *4).
But you really should read the manual on optimisation!!!
> The machine is to be used for nothing else but running the database and
> webserver so it is ok to eat all the resources for this.
Use as much RAM you can for mysql.
> Since there is no boolean type in mysql i wonder what the best solution is;
> using tinyint(1) or something else...
You can use tinyint or char(1). Both will be stored as 1 Byte.
> Is there any difference in tinyint(1) and int(1)?
> The manual states that Tinyint goes from -127 to 128 or 0 to 255 if unsigned,
> which looks alot like 8 bits to me, but when i create a tinyint row and don't
> set length it defaults to length 4, so what is the length a number for? i
> thought it was the bit length, but it doesn't seem so, since int defaults to
> length 11 although it seems to handle 32 bit numbers.
> I figure the length might be characters since -127 is 4 chars, but then default
> length of unsigned tinyint should be one less than signed (e.g. 3), but it is
The length given in braces are the number of _decimal_ digits as you assumed.
> Is there anyway to set the bitlength of a record so you could create a flag with
> the number of bits you need in that table?
You can only work on byte basis.
> Martin B. Jespersen