Bug #60701 BIT(1) versus TINYINT(1)
Submitted: 30 Mar 2011 19:59 Modified: 31 Mar 2011 17:39
Reporter: Guillaume Boissiere Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5 OS:Any
Assigned to: Paul Dubois CPU Architecture:Any
Tags: Best practices
Triage: Needs Triage: D5 (Feature request)

[30 Mar 2011 19:59] Guillaume Boissiere
Description:
As of MySQL 5.5, is there any reason why we shouldn't explicitely tell people in the MySQL documentation to use BIT(1) columns rather than TINYINT(1) to store boolean values?

Isn't this the best practices now?  Doesn't BIT(1) provide better performance?

How to repeat:
This page is very unclear about what is the best practice to store boolean values:

http://dev.mysql.com/doc/refman/5.5/en/numeric-types.html
[30 Mar 2011 20:18] Miguel Solorzano
Thank you for the bug report.
[31 Mar 2011 17:39] Paul Dubois
We do not have a "best practices" recommendation. Use whichever type you like.

A similar "on/off" type, BOOL, is mapped by MySQL to TINYINT(1), which suggests that TINYINT(1) is acceptable.

mysql> CREATE TABLE t (b BOOL);
Query OK, 0 rows affected (0.01 sec)

mysql> SHOW CREATE TABLE t\G
*************************** 1. row ***************************
       Table: t
Create Table: CREATE TABLE `t` (
  `b` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)