From: Christian Mack Date: March 17 1999 2:54pm Subject: Re: configuration question List-Archive: http://lists.mysql.com/mysql/426 Message-Id: <36EFC23F.51D8EAD8@compal.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Martin B. Jespersen" wrote: > > Hi, > > I have a couple of questions: > > Q1: > 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: > > [mysqld] > 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. > Q2: > 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. > Q3: > Is there any difference in tinyint(1) and int(1)? No. > Q4: > 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 > not. The length given in braces are the number of _decimal_ digits as you assumed. > Q5: > 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 Tschau Christian