I've been monitoring slow-queries.log to try and find
querys that might be causing problems.  I see the
following logged:

# Time: 020903 16:59:14
# User@Host: cfweb[cfweb] @ storm.centurytel.net
[10.10.1.17]
# Query_time: 47  Lock_time: 0  Rows_sent: 5 
Rows_examined: 145240
SELECT
                               
clari_category.image_exists,
                                clari_article.id,
                               
clari_article.image_url_standard 
                        FROM
                                clari_category
                        LEFT JOIN
                                clari_article ON
clari_category.id = clari_article.id
                        WHERE
                               
clari_category.datestamp >  '2002-09-01' 
                                AND
clari_category.image_exists = '0'
                                AND
clari_article.image_url_standard != '';


But when I do an explain on the same query I get:

+----------------+--------+---------------------------------------------------------------+-------------+---------+-------------------+------+------------+
| table          | type   | possible_keys             
                                   | key         |
key_len | ref               | rows | Extra      |
+----------------+--------+---------------------------------------------------------------+-------------+---------+-------------------+------+------------+
| clari_category | ref    |
idx_imagekey,idx_imagestoryvalidation,idx_datestamp,idx_photo
| idx_photo   |       1 | const             | 1448 |
where used |
| clari_article  | eq_ref |
idx_primary,idx_datearticle                           
       | idx_primary |     100 | clari_category.id |  
 1 | where used |
+----------------+--------+---------------------------------------------------------------+-------------+---------+-------------------+------+------------+
2 rows in set (0.00 sec)


I don't understand why the query is examining 145240
rows when explain says it should be limited to 1448? 
Am I missing something?  

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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

Reply via email to