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
Question 20: Which of the following are probably bad index choices? – MySQL Question of the Day

Skip to content

By urs in mysql questions

 
(Find all)
 

a) index on "gender"
b) index on "monthly_sum"
c) index on "sales_date"
d) index on "user_id"

 
[ Tables and Indexes (15%) - Indexes ]
 

Tags: , ,

Comment Feed

One Response


  1. 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.
     

You must be logged in to post a comment.