Partition notes table
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
As the initial step towards reducing the size of the notes table, we need to partition the table. We don't plan on splitting the table at the moment, and will just hash partition by multiple columns.
See #396797 (comment 1324459936) and https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/notes_table_partitioning/ for more details.
Proposed steps
Step 1:
- Add
namespace_idcolumn tonotes - Add
namespace_idforeign key constraint and index - Make sure
notes.namespace_idis populated correctly when notes are created, cloned (when cloning and moving issues), and imported - Backfill
notes.namespace_idfor old notes
Step 2:
- Add other indexes which include
namespace_id - Make sure queries to notes include a
namespace_idclause
Step 3:
- Create partitioned copy of
notes - Backfill the partitioned copy
- Finalize backfill and swap the tables
Edited by 🤖 GitLab Bot 🤖