Commit 2e51be25 authored by Toon Claes's avatar Toon Claes

Merge branch '221184-rolling-28-day-snippets-optimization' into 'master'

Optimize rolling 28 days snippets counter

See merge request gitlab-org/gitlab!34918
parents 7c5cfb4d b7f24241
---
title: Optimize rolling 28 days snippets counter
merge_request: 34918
author:
type: performance
# frozen_string_literal: true
class AddIndexOnIdAndCreatedAtToSnippets < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :snippets, [:id, :created_at]
end
def down
remove_concurrent_index :snippets, [:id, :created_at]
end
end
......@@ -10960,6 +10960,8 @@ CREATE INDEX index_snippets_on_description_trigram ON public.snippets USING gin
CREATE INDEX index_snippets_on_file_name_trigram ON public.snippets USING gin (file_name public.gin_trgm_ops);
CREATE INDEX index_snippets_on_id_and_created_at ON public.snippets USING btree (id, created_at);
CREATE INDEX index_snippets_on_id_and_type ON public.snippets USING btree (id, type);
CREATE INDEX index_snippets_on_project_id_and_visibility_level ON public.snippets USING btree (project_id, visibility_level);
......@@ -14086,6 +14088,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200617001637
20200617001848
20200617002030
20200618105638
20200618134223
20200618134723
\.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment