MySQL Forums
Forum List  »  General

Jet Profiler says I'm slow....
Posted by: Hans de Bruin
Date: August 30, 2012 08:16AM

Hi people,

Hope someone can help me here. I am analyzing my php/mysql project using
JetProfiler, and it warns me of several slow queries. There's one here I would like to figure out with your help.

The table has about 250,000 rows. Users are able to browse through them 20 at a time. The query looks like this:

SELECT * FROM items WHERE CAT='sports' ORDER BY DATUM DESC LIMIT 31900,20

Explain on JetProfiler says: JOIN SIZE 56,841 (VERY BAD,VERY SLOW) using FILESORT (BAD)

Now, obviously this is a google spider browsing through all the items (which is good) so the LIMIT 31900,20 seems to slow it down. Am I right in thinking that with this query it SELECTS about 32000 rows to display the last 20 ? Where does the 56,841 join size come from ?

CAT has a BTREE index (cardinality 48) as well as DATUM (the date).

Is there any other way to select 20 rows, skipping the first 32,000 ?

Options: ReplyQuote


Subject
Written By
Posted
Jet Profiler says I'm slow....
August 30, 2012 08:16AM
September 01, 2012 08:38AM


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.