--- Jeff Lacki <[EMAIL PROTECTED]> wrote:
>
+-----------------+--------------+------+-----+------------+-------+
> | Field           | Type         | Null | Key |
> Default    | Extra |
>
+-----------------+--------------+------+-----+------------+-------+
> | id              | bigint(20)   |      |     | 0   
>       |       |
> | is_active       | varchar(10)  |      |     |     
>       |       |
> | last_login      | date         |      |     |
> 0000-00-00 |       |
> | reason          | varchar(100) | YES  |     | NULL
>       |       |
> | term_reason     | varchar(100) | YES  |     | NULL
>       |       |
> | last_login_time | time         |      |     |
> 00:00:00   |       |
>
+-----------------+--------------+------+-----+------------+-------+
> 6 rows in set (0.00 sec)
> 
> When I removed the is_active and user_account1 from
> the following
> select statement it is immediate:
> 
>  SELECT userid, nickname, city, state, country,
> email, sex, birthday, marital_stat, num_children,
> height, weight, smoke, drink, born_again, image1,
> is_active FROM users1, user_stats1, user_wants1,
> user_account1 WHERE sex='m' AND
> userid=user_stats1.id AND userid=user_wants1.id AND
> userid=user_account1.id;
> 
> Id still like to know why, but at least its a huge
> start.
> 
> Jeff
> 

Hi Jeff,

  Since user_account1.id is not an index of
user_accound1, the server has to go and browse the
whole dataset to search for matches, try creating an
index on user_account1 using id and run an explain
statement against your query.

hope it helps,
esv.


Enrique Sanchez Vela
email: [EMAIL PROTECTED]
-----------------------------------------------------------------------------
It's often easier to fight for one's        ||    We live in the outer space    
           
principles than to live up to them        ||    Rev. Kay Greenleaf
Adlai Stevenson                                ||


                
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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

Reply via email to