indexing - MySQL: Index for two boolean fields -


i have mysql table 2 boolean (tinyint or bit or this) fields.

for efficient counting (and paginating in general, "cutting" slice db show in page of pagination) rows both booleans false, should create index on each of these 2 fields, composite index on both fields, or both?

normally when you're talking indexing data need accommodate columns included in where clause. is, if you're doing:

select * boolean_table a_flag=0 , b_flag=0 

then yes, need index on a_flag,b_flag. if there additional fields involved in filtering need included well.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -