[dev] Links API + performance

Bo Daley bo at tilda.com.au
Wed Oct 15 23:06:08 PDT 2003


More clueless questions (I'm not doing too well this week ;)

Quoting Chuck Hagenbuch <chuck at horde.org>:

> 1. Ditch the SQL driver/serialization for links, and rewrite it to use
> categories (and category_attributes for what's currently serialized).

Does the Categories driver support searching for categories on the basis of
multiple attributes? I can only seem to get the getCategoriesByAttributes to
match on a single attribute at a time (which makes it difficult to find links
stored in the categories rather than in a serialized field). ie. I can get the
categories to produce SQL that looks like this:

SELECT a.category_id, c.category_name
FROM horde_category_attributes a
LEFT JOIN horde_categories c ON a.category_id = c.category_id
WHERE c.group_uid = 'horde.links'
AND (attribute_key = 'link_type'
AND attribute_value = 'tickets/client')


but not this:

SELECT a1.category_id, c.category_name
FROM horde_categories c
LEFT JOIN horde_category_attributes a1 ON a1.category_id = c.category_id
LEFT JOIN horde_category_attributes a2 ON a2.category_id = c.category_id
LEFT JOIN horde_category_attributes a3 ON a3.category_id = c.category_id
WHERE c.group_uid = 'horde.links'
AND (a1.attribute_key = 'link_type'
    AND a1.attribute_value = 'tickets/client')
AND (a2.attribute_key = 'from_key'
    AND a2.attribute_value = 'module_id')
AND (a3.attribute_key = 'from_value'
    AND attribute_value = '15')


Am I missing something maybe?

thanks,

bo.




More information about the dev mailing list