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` =1 runs in 0.07 seconds with 200,000 records.

When I add indeces to fields f01 and f02, the query now takes 0.23 seconds. Is this expected? Is this simply the time required to load the index? Are indeces simply not designed to work with something of such low cardinality?

Thanks,
Jon


--

Chance favors only a prepared mind.

Jon Beyer
302N Dod Hall
Princeton University
Princeton, NJ 08544

609 986 8722

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to