Replace temporary productivity analytics index
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
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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