View Single Post
  #4  
Old 10-22-2009, 05:21 AM
 
BritSteve BritSteve is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 339
 

Default Re: Optimize mysql query

What is the ratio of rows that satisfy the condition? I mean how many of the 100,000 rows have a fieldid of 4 and are not null. Is there a primary key, like ID that is numeric?

I agree that the SQL is getting the relevant rows, adding the rand and then sorting them, probably using a temp table.

There are other ways you can try, but it will involve some PHP coding.

Steve
__________________
Version 4.1.8 & 4.1.9
ezcheckout4.1.x
cdseolinks2
product_metatags41x
shipping_per_product41x

http://www.earthsmagic.com
Reply With Quote