Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php:4991) in /www/htdocs/v030397/mysql-qotd/wp-includes/feed-rss2-comments.php on line 8
Comments on: Question 20: Which of the following are probably bad index choices? http://mysql-qotd.casperia.net/archives/198 mysql 5.0/5.1 questions for learning purposes Fri, 06 Aug 2010 16:56:36 +0000 http://wordpress.org/?v=abc hourly 1 By: urs http://mysql-qotd.casperia.net/archives/198/comment-page-1#comment-26 urs Tue, 16 Feb 2010 18:08:58 +0000 http://mysql-qotd.casperia.net/?p=198#comment-26 <b> Answers:   a b   The gender doesn't have a lot of distinct values, so an index on it will not restrict the data very much. Indexing a sum is probably not a good idea either, as usually you want to report sums but not select by them. A date field is probably a good candidate for an index, as processing by date is a common task. Also indexing a user-id sounds like a good idea.   </b>
Answers:
 
a b
 
The gender doesn’t have a lot of distinct values, so an index on it will not restrict the data very much. Indexing a sum is probably not a good idea either, as usually you want to report sums but not select by them. A date field is probably a good candidate for an index, as processing by date is a common task. Also indexing a user-id sounds like a good idea.
 

]]>