Loris
Loris copied to clipboard
CommentID should be deprecated
The flag table uses a varchar(255) called CommentID as a primary key. This makes for poor joins and excessively long table scans on large datasets. There is an autoincremented integer named ID on the flag table which should be used instead as the key in joins without any changes in user-facing functionality. However, the CommentID is referred to in many places in the code, so deprecating it may be tricky but will drastically improve the scaleability of LORIS.
I propose a phased approach.
- Update queries that use flag.CommentID in a join to use flag.ID instead (LORIS v27.0?) to improve join performance
- Move the CommentID to a separate flagid_commentid_rel table to improve table scans while maintaining the API places that use it in a request (v28.)
- Add support for using the FlagID instead of CommentID in those places (v28) 3a. update LORIS frontend to pass FlagID instead of CommentID 3b. Deprecate using CommentID
- Remove
flagid_commentid_reltable (v29+)