[dev] Tags and Oscar

Michael Rubinsky mike at theupstairsroom.com
Tue Sep 18 13:46:07 UTC 2007


Quoting Duck <duck at obala.net>:

> On Sunday 16 of September 2007 22:27:09 Michael Rubinsky wrote:
>> Wanted to start a discussion regarding the way tags are or will be
>> implemented in Oscar.  Currently they are flat, each video's tags
>> store with the video's information in the db row.  This has the
>> benefit of allowing us to include recency information in the tag
>> cloud, since we have to search each record for the tags anyway.
>>
>> I'd like to get thoughts on normalizing the oscar_videos table such
>> that we have a oscar_tags table and a oscar_video_tags table.  I don't
>> have a strong opinion as to which is better for Oscar, but I'm
>> wondering if the normalized tables would be more efficient for things
>> like finding related tags (we wouldn't have to search each row of the
>> oscar_videos table for tag information...with mulitple OR clauses for
>> each tag we're looking for) and for building the cloud, since, again,
>> all we'd have to do is query the oscar_video_tags table.  What we
>> *would* lose, however, would be the date information as we'd have to
>> do some sort of MAX query for each tag in the cloud - *not* very
>> efficient.
>>
>> Just looking for some input before I/we spend too much time working
>> out the tag searching...
>
> Joins will slow all things down. Using a dedicated table will be appropriated
> if we have videos without tags as will minimize the data stored. But every
> video has its tags (at least extracted from the title).

I don't see where we are extracting tags from the title...is that the  
plan?  Is it still more efficient to have php iterate through the  
entire result set (after applying all the video_tags LIKE %searchterm%  
OR .... clauses), split all the tags and titles by space, then build a  
new array?  I'm not saying it's not more efficient, I just thought it  
was always better to have the rdbms do this type of grunt work instead  
of the php engine when possible....could be wrong though :)



Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

"Time just hates me. That's why it made me an adult." - Josh Joplin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: PGP Digital Signature
Url : http://lists.horde.org/archives/dev/attachments/20070918/d29c8355/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 2013 bytes
Desc: PGP Public Key
Url : http://lists.horde.org/archives/dev/attachments/20070918/d29c8355/attachment-0001.bin 


More information about the dev mailing list