i think if your boolean field is such that you would be referring to them in many cases, it would make sense to have a separate table, example DeletedPages, or SpecialPages, which will have many boolean type fields, like is_deleted
, is_hidden
, is_really_deleted
, requires_higher_user
etc, and then you would take joins to get them.
Typically the size of this table would be smaller and you would get some advantage by taking joins, especially as far as code readability and maintainability is concerned. And for this type of query:
select all pages where is_deleted = 1
It would be faster to have it implemented like this:
select all pages where pages
inner join DeletedPages on page.id=deleted_pages.page_id
I think i read it somewhere about mysql databases that you need a field to at least have cardinality of 3 to make indexing work on that field, but please confirm this.