Indexes 1.speedup search on indexed columns. (primary optimization technique) alter table t1 Add INDEX (fi) alter table t1 Drop INDEX fi Try it on bignum field of japan table. select * from japan where bignum=574181552; Note the time used. alter table japan Add INDEX (bignum); select * from japan where bignum=574181552; Note the time used. ****************************************************************** 2 datatypes that restrict/constrain the allowable/possible/valid string values a field can be. Enumerated types: (a list of the only possible string values) restricts the possible values that the stringy column can have. tighter control=higher integrity of the data. ENUM('val1','val2',...) can be any one of the up to 64K listed "members". sex ENUM('m','f') instead of CHAR(1). No other value can be in this column. species ENUM('cat','dog','snake','bird','hamster') bonus ENUM('n','y') bonus ENUM('no','yes') rating ENUM('good','bad','ugly') boolean ENUM('true','false') #true and false are keywords continent ENUM('Africa','Antarctica','Asia','Australia','Europe','North America','South America') state ENUM('AK','AL','AR','AZ','CA','CO','CT','DC','DE','FL','GA','HI','IA','ID','IL','IN','KS', 'KY','LA','MA','MD','ME','MI','MN','MO','MS','MT','NC','ND','NE','NH','NJ','NM','NV', 'NY','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VA','VT','WA','WI','WV','WY') Strict mode: Inserting/Updating invalid value is error. (except can insert Null, if Null allowed) Queries are same, no difference. Except Order By is in enum order, not necessarily alphabetical. Cast(my_enum_field AS Char) SET('val1','val2',...) any subset (combo) of up to 64 string values. features SET('adorable','housebroken','redzone','fixed','mellow') symptom SET('sneezing','runny nose','stuffy head','red eyes') comma separated list of values when Insert/Update: Insert ... set symptom='runny nose,red eyes' Insert ... set symptom='' #no symptoms. empty set Can be Inserted in any order: Insert ... set symptom='runny nose,red eyes,sneezing' but will display in created order Inserting/Updating invalid values is Error in Strict mode. Insert ... set symptom='runny nose,retching' fails Querying: No special operators etc. select features ... select * from pet where features like '%fixed%'; select * from pet where features like '%fixed%' and features like '%adorable%'; select * from pet where features like 'fixed'; and nothing else select * from pet where features like ''; no features select * from pet where features not like '%redzone%'; Avoid using = operator, use the like operator.