Why is it bad to use boolean flags in databases? And what should be used instead?

Posted by David Chanin on Stack Overflow See other posts from Stack Overflow or by David Chanin
Published on 2010-06-15T04:40:47Z Indexed on 2010/06/15 4:42 UTC
Read the original article Hit count: 288

I've been reading through some of guides on database optimization and best practices and a lot of them suggest not using boolean flags at all in the DB schema (ex http://forge.mysql.com/wiki/Top10SQLPerformanceTips). However, they never provide any reason as to why this is bad. Is it a peformance issue? is it hard to index or query properly?

Furthermore, if boolean flags are bad, what should you use to store boolean values in a database? Is it better to store boolean flags as an integer and use a bitmask? This seems like it would be less readable.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about database