Skip to content

Replace temporary productivity analytics index

Pavel Shutsin requested to merge 32229-followup-pa-merged-at-index into master

What does this MR do?

As part of migration for productivity analytics temporary index was introduced. This MR removes data migration source code because we don't want to use it. Replace data migration specific index with simpler one for the app itself.

Execution plans for metrics query:

explain SELECT "merge_request_metrics"."merged_at" FROM "merge_request_metrics" WHERE (merged_at > '2019-09-01') AND "merge_request_metrics"."commits_count" IS NOT NULL ORDER BY "merge_request_metrics"."merged_at" ASC LIMIT 1

 Limit  (cost=0.44..5.85 rows=1 width=8) (actual time=364.352..364.354 rows=1 loops=1)
   Buffers: shared hit=435946
   ->  Index Scan using merge_request_metrics_merged_at on public.merge_request_metrics  (cost=0.44..155318.95 rows=28687 width=8) (actual time=364.350..364.351 rows=1 loops=1)
         Index Cond: (merge_request_metrics.merged_at > '2019-09-01 00:00:00'::timestamp without time zone)
         Filter: (merge_request_metrics.commits_count IS NOT NULL)
         Rows Removed by Filter: 441710
         Buffers: shared hit=435946

Includes !17933 (merged) because it modifies related code. Related to #32604 (closed)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #32229 (closed)

Edited by Pavel Shutsin

Merge request reports