MySQL Forums
Forum List  »  Optimizer & Parser

Re: Optimize a query
Posted by: Rick James
Date: March 13, 2011 03:48PM

How many rows are returned by that first query?
What is the value of key_buffer_size?
How much RAM do you have?

SELECT  `tbl`.*
    FROM  `jos_clothes_view_products` AS `tbl`
    WHERE  `tbl`.`cat1` != 'NULL'
      AND  `tbl`.`enabled` = '1'
    ORDER BY  `created_on` DESC , `ordering` ASC
    LIMIT  0 , 20;
might benefit from a compound index:
INDEX(created_on, ordering)

Options: ReplyQuote


Subject
Views
Written By
Posted
2866
March 10, 2011 08:59AM
Re: Optimize a query
1398
March 13, 2011 03:48PM
1473
March 14, 2011 03:35PM
1484
March 14, 2011 06:26PM
1336
March 15, 2011 02:20PM
1377
March 15, 2011 09:12PM
1279
March 28, 2011 06:20AM


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.