Skip to content

[VSA] Create the new tables for capturing stage events

Create database structure for the new VSA tables.

Tables:

  • analytics_cycle_analytics_merge_request_stage_events
  • analytics_cycle_analytics_issue_stage_events

Structure:

column type description
stage_hash_id bigint points to the stage hash record: #335291 (closed)
merge_request_id or issue_id bigint composite primary key with stage_hash_id
group_id bigint Project's group
project_id bigint Project where the merge request was created
start_event_timestamp datetime stores the start event timestamp for the stage
end_event_timestamp datetime stores the end event timestamp for the stage
milestone_id bigint same as issuable.milestone_id
author_id bigint same as issuable.author_id

1 row: 64 bytes

Partitioning strategy:

We might need to create 2 sets of tables:

  • One set is for groups or projects where we store data for a certain time period (time decay, time range partition).
  • One set is for ultimate customers, here we can use hash partitioning based on the stage_hash_id.

Focus on the hash partitioning within this issue. We can decide how to deal with the time decay data at a later step.

Edited by Dan Jensen