MySQL Forums
Forum List  »  Optimizer & Parser

TINYINT(1) or ENUM( 'true' , 'false')
Posted by: yoderek
Date: February 23, 2006 01:56PM

Which would be the more optimzed way to store a boolean, TINYINT(1) or ENUM( 'true' , 'false')? It seems that when storing an enum w/ two settings should only take up one bit, 0 or 1, but would spend more time looking up the enums in the beginning of the query. tinyint(1) however would take up 4 bits assuming it ranged 0-9. So it seems if you just wanted to fetch the value, tinyint(1) would be faster, but if you are searching through lots of records enum('true','false') would be faster. Do you concur??

Options: ReplyQuote

Written By
TINYINT(1) or ENUM( 'true' , 'false')
February 23, 2006 01:56PM
February 23, 2006 11:12PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.