List:General Discussion« Previous MessageNext Message »
From:Grant Giddens Date:December 21 2005 6:44pm
Subject:Re: Do I need to tweak my server variables for this SELECT statement?
View as plain text  
It'll be a few hours before I get home and can do  this query with the variations you
mentioned.  I don't know if I  need the separate index key on `salesrank` or not.  I
thought it  would speed up my query be having it.
  
  In the previous email I included the results from doing an EXPLAIN.  It shows:
  table        type         possible_keys         key        key_len         ref       
rows        Extra
    pn_pricecompare_catprod      ref      PRIMARY,asin      PRIMARY     4       const    
369308       Using where; Using index; Using temporary; Using f...
    pn_pricecompare_product      eq_ref      asin      asin     10      
pn_pricecompare_catprod.asin     1
  
  The formatting is funky from my cut and paste, but it looks like 369,308 rows for this
particular query.
  
  I think the product table has about 650,000 rows, and the category table has about
8,150,000 rows.
  
  Thanks,
  Grant

Hank <heskin@stripped> wrote:  Ok, so the next step would be to try the original
query with just the
LIMIT clause, and then just the ORDER BY (but not both).

The results of "select count(*)" query would be helpful to know just
how many records mysql is trying to sort and limit.

And do you really need a separte index key on `salesrank` on the
product table?

-Hank



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Thread
Do I need to tweak my server variables for this SELECT statement?Grant Giddens21 Dec
Re: Do I need to tweak my server variables for this SELECTstatement?James Harvard21 Dec
  • Re: Do I need to tweak my server variables for this SELECT statement?Grant Giddens21 Dec
    • Re: Do I need to tweak my server variables for this SELECT statement?Hank21 Dec
      • Re: Do I need to tweak my server variables for this SELECT statement?Grant Giddens21 Dec
        • Re: Do I need to tweak my server variables for this SELECT statement?Hank21 Dec
          • Re: Do I need to tweak my server variables for this SELECT statement?Grant Giddens21 Dec
          • Re: Do I need to tweak my server variables for this SELECT statement?Grant Giddens21 Dec
            • Re: Do I need to tweak my server variables for this SELECT statement?Hank23 Dec
              • Re: Do I need to tweak my server variables for this SELECT statement?Grant Giddens23 Dec
                • Re: Do I need to tweak my server variables for this SELECTstatement?James Harvard23 Dec
                  • Re: Do I need to tweak my server variables for this SELECT statement?Grant Giddens23 Dec
                    • Re: Do I need to tweak my server variables for this SELECT statement?Hank24 Dec
    • Filtering joinEris Ristemena21 Dec
      • Re: Filtering joinPeter Brawley21 Dec
      • Re: Filtering joinGleb Paharenko21 Dec
    • Re: Do I need to tweak my server variables for this SELECTstatement?James Harvard21 Dec
    • Re: Filtering joinEris Ristemena21 Dec
    • Re: Filtering joinEris Ristemena21 Dec
      • Re: Filtering joinSGreen21 Dec
        • Re: Filtering joinEris Ristemena21 Dec
          • Re: Filtering joinSGreen21 Dec
            • Re: Filtering joinEris Ristemena21 Dec
Re: Do I need to tweak my server variables for this SELECT statement?Grant Giddens21 Dec
  • Re: Do I need to tweak my server variables for this SELECT statement?Hank21 Dec
    • Re: Do I need to tweak my server variables for this SELECT statement?SGreen21 Dec