Review notes table for partitioning
In gitlab-com/gl-infra/production#4633 (closed), we were unable to create a GIN trigram index on the notes
table in an acceptable time.
GIN trigram indexes are exceptionally slow to build. However, the underlying cause is that there is a massive amount of data that needs to be indexed.
In this issue, we're going to review what changes we can make to improve this situation. The goal is to be able to create a GIN index on notes
within a more reasonable time (that doesn't make us concerned about txn wraparound).
Actions to consider:
- Partitioning to reduce individual table sizes
- Retention - drop data if we can, though that seems unlikely in this case
- ?