[wp-hackers] Re: [ slow queries in 1.2

Owen Winkler ringmaster at midnightcircus.com
Fri Nov 19 14:52:57 UTC 2004


Dougal Campbell wrote:

> Ryan Boren wrote:
>
>> Beyond that, we should fix the query.  For huge $posts arrays we could
>> skip the post_id_list stuff and just pull every post.  Would that be
>> faster?  Is their a more elegant query we could use?  
>
> I haven't tried an actual benchmark, but I would have to believe that 
> if we detected a post count over a certain threshold, and executed a 
> different query that just avoided the IN clause, the SQL engine would 
> be able to optimize the query much better. SQL derives from 
> mathematical set theory, and when you specify a huge list of 
> conditions which must all be checked individually (as opposed to a 
> more general condition), it's bound to slow things down.
>
Forgive me for butting in where I have no practical experience 
(WordPress query optimization), but isn't there a way to JOIN in MySQL?  
Isn't that the kind of query that we're talking about?

Owen





More information about the hackers mailing list