[wp-hackers] geocomments?

Dougal Campbell dougal at gunters.org
Fri Apr 14 14:06:54 GMT 2006


Stewart Ugelow wrote:
>> All of which is more efficient than querying against a single table with
>> an extra WHERE parameter, indexed or not.
> 
> Really? Even if it's a multi-column index as described at
> http://dev.mysql.com/doc/refman/4.1/en/multiple-column-indexes.html?

Yes, MySQL supports multi-column indexes. But even so, I'm not sure that 
I'd prefer the single-table approach. Even though the format of the 
information is the same, the metadata for posts, comments, users, links, 
categories, etc. is not directly related to each other (*somewhat* 
related, but not really).

And even with the multi-column indexes to zero in on the rows you're 
looking for, if you combine everything, the index is going to contain 
exponentially more non-matching rows than if you keep separate meta 
tables for each type of data, which might cancel out the benefits for 
sites that track *lots* of metadata.

On the surface, it might seem more efficient to combine them, but I'd 
favor the semantics of keeping the tables separate. Unless a database 
expert can give concrete reasons that combining them would gain some 
real benefit.


-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/



More information about the wp-hackers mailing list