Loris icon indicating copy to clipboard operation
Loris copied to clipboard

CommentID should be deprecated

Open driusan opened this issue 1 year ago • 0 comments

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.

  1. Update queries that use flag.CommentID in a join to use flag.ID instead (LORIS v27.0?) to improve join performance
  2. 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.)
  3. 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
  4. Remove flagid_commentid_rel table (v29+)

driusan avatar Sep 24 '24 18:09 driusan