On Mon, 2002-11-18 at 12:29, Jeremy Zawodny wrote: > > If I've got you right status can have values 0 or 1. In this case > > you can just use " SELECT ... WHERE status=1 .." (index wil be used) > > or "SELECT .. WHERE status=0 .." (index will not be used, because > > scan the whole table will be faster to retrieve 99,9% of rows) > > depends on what you want to get. > > I'd like to second Nathan's request. > > Just because MySQL is smart enough to not use an index when 99% of the > rows would match doesn't mean that this is an unnecessary request. > It'd be a great optimization it MySQL could "know" not to bother > indexing those records. It'd save a lot of space and CPU time on > larger data sets. > > Jeremy
I think this problem could be solved by implementing a BITMAP index, like Oracle. They're perfect for indexing boolean true/false columns or any column that has a small number of possible values. -- Daniel Koch <[EMAIL PROTECTED]> --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php