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

Owen Winkler ringmaster at midnightcircus.com
Fri Nov 19 19:11:27 UTC 2004


Tor Bjornrud wrote:

> Owen Winkler wrote:
>
>>>
>> 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?
>
>
> I don't know the actual JOIN keyword syntax, but grabbing a bunch of 
> data from multiple tables is no sweat.
>
> SELECT DISTINCT table1.data FROM table1, table2 WHERE 
> table2.id=table1.id AND table2.realfield='whatyouweresearchingby';
>
> To add more tables, just make you add the tablename to the FROM area, 
> and relate table records by keys that match up.

On second look, it won't be possible to do this because the list of 
posts that is passed to update_post_caches() can come from different 
sources, so there is no easy way to use a JOIN to get the results.  And, 
as you point out, JOINing is a 4.0+ feature that not everyone has access to.

Owen





More information about the hackers mailing list