Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the performance and usefulness of the annotation table #7945

Open
jon-betts opened this issue Apr 20, 2023 · 0 comments
Open

Increase the performance and usefulness of the annotation table #7945

jon-betts opened this issue Apr 20, 2023 · 0 comments
Assignees

Comments

@jon-betts
Copy link
Contributor

jon-betts commented Apr 20, 2023

Tasks

The problem

Our current annotation table originated from an ElasticSearch index, and does not make full use of relational database semantics.

Ideally we'd like a set of tables which:

  • Enable fast queries
  • Makes use of simple and direct foreign keys for relationships with other objects like groups and users
  • Has an auto-increment primary key

Difficulties this causes us

This has some bad outcomes for us:

  • Joining from the annotation to the user table is difficult and inefficient
  • The annotation table contains a lot of information, and is very large
  • This makes it extremely slow to query
  • There is no index on the created column

There is complicated logic required to perform reporting and certain types of query over the annotation table for the email digest functionality. Reporting in particular is a sore point, as we have to replicate the structure into a whole new table, which prevents us from easily changing anything to do with annotations. Ad-hoc reporting is basically off the table.

The plan so far

  • Consolidate annotation related interactions inside services
  • Consider creating a parallel data structure in a new and nicer format
  • Swap the existing table over to be a view over the new nicer tables
  • Swap services etc to use the new tables under the hood
  • Remove the backward compatibility view
  • Consider where we can optimise reporting or email digest related functionality and other benefits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant