Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to store boolean data?

Status
Not open for further replies.

PracticalProgra

Programmer
Mar 17, 2002
4
US
I know that I can store boolean data (Yes/No) as a TINYINT or as an ENUM.

But which is better, in the long run?

I am carefully planning-out an application which will, eventually, contain a very, very large table with a couple of these boolean fields.

Both will occupy a single byte for a single row's data, so they are equivalent, in terms of data storage space.

Is one better than the other for any other reason?

From a reporting speed standpoint, do indexes on a TINYINT perform better that on an ENUM, or visa-versa?

Thanks.
 
I'd probably go with the ENUM but only because the values are more intuitive. In terms of processing requirements, they should be about even. ______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top