#208: Optimize table structure for autosuggest
----------------------+-----------------------------------------------------
Reporter: vengmark | Owner: vengmark
Type: task | Status: new
Priority: minor | Milestone: v1.0
Component: WebTag | Version:
Keywords: |
----------------------+-----------------------------------------------------
Try to change the single table structure into several tables to avoid
DISTINCT in autosuggest selection:
tagREC: id, bibrec_id, user_tag_id (foreign key), etc.
tagUSER_TAG: id, uid, tag
Profile autosuggest: Current function vs.
{{{
#!sql
select tag
from tagUSER_TAG
where user_id = %s;
}}}
Problematic insert: Have to either check whether the record exists or try
to insert it and ignore a duplicate row error.
Ditto for delete: Have to check whether the tagUSER_TAG.id is referred by
any other records.
--
Ticket URL: <http://invenio-software.org/ticket/208>
Invenio <http://invenio-software.org>