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


I'm reading in some guides on database optimization and best practices and many of them suggest that the use of the Boolean flag Do not, however, all in the DB schema (ex), they never tell a reason why it is bad. Is this a peformance issue? Is this index or query properly fixed?

In addition, if Boolean flags are bad, then what should you use to store boolean values ​​in the database? Is it better to store boolean flags and use bitmasks as an integer? It seems that it will be less readable.

I do not think it is is bad and I have given a reason for it Have you ever seen some old database engine could not keep them efficiently, but modern people do as you say, it is very much readable to use booleans compared to bit masks. See this question for a similar discussion:


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -