MySQL Forums
Forum List  »  InnoDB

Re: Don't understand why is this happening
Posted by: Pavel Baranov
Date: August 07, 2008 10:00AM

this is just dumb... check this out i added a combined index with sex and age in it:
EXPLAIN select p.id, p.sex, p.age from profiles as p inner join profile_locations as pl force index (country_region_city_profile) on pl.profile_id = p.id where p.first_name = 28353 and p.last_name = 480607 and pl.country_id = 222 and pl.region_id = 3830 and pl.city_id = 1888105;
+----+-------------+-------+------+-----------------------------------------------------------------------------------------+------------------------------------+---------+--------------------------------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+-----------------------------------------------------------------------------------------+------------------------------------+---------+--------------------------------+------+--------------------------+
| 1 | SIMPLE | p | ref | PRIMARY,first_links_sex_age_id,first_last_middle_links_sex_age_id,last_links_sex_age_id | first_last_middle_links_sex_age_id | 10 | const,const | 9074 | Using where; Using index |
| 1 | SIMPLE | pl | ref | country_region_city_profile | country_region_city_profile | 16 | const,const,const,p.id | 1 | Using index |
+----+-------------+-------+------+-----------------------------------------------------------------------------------------+------------------------------------+---------+--------------------------------+------+--------------------------+

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Don't understand why is this happening
1603
August 07, 2008 10:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.