Re: index slowing things down?

2005-05-06 Thread Brent Baisley
Use explain to see what MySQL is doing. My guess is that MySQL is trying to figure out if it would be faster to use the index or scan the whole table. MySQL is probably deciding that it is quicker to scan the whole table based on the low cardinality of the indices it can use. Thus, you've just a

index slowing things down?

2005-05-06 Thread Jon Beyer
I was playing around with a table that had 100 tinyint fields. Each record contained other a '0' or a '1' for each field. A query such as SELECT * FROM `foobar` WHERE `f01` =1 AND `f02` =1 AND `f03` =1 AND `f04` =1 AND `f05` =1 AND `f06` =1 AND `f07` =1 AND `f08` =1 AND `f09` =1 AND `f10` =