Commit 515ebe0a authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '208891-optimize-todos-counters' into 'master'

Optimize todos counters in usage data

See merge request gitlab-org/gitlab!26442
parents 8e6b6f2e f191e9f4
---
title: Optimize todos counters in usage data
merge_request: 26442
author:
type: performance
# frozen_string_literal: true
class AddIndexOnAuthorIdAndCreatedAtToTodos < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :todos, [:author_id, :created_at]
end
def down
remove_concurrent_index :todos, [:author_id, :created_at]
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_03_04_160823) do
ActiveRecord::Schema.define(version: 2020_03_06_170531) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
......@@ -4150,6 +4150,7 @@ ActiveRecord::Schema.define(version: 2020_03_04_160823) do
t.integer "note_id"
t.string "commit_id"
t.integer "group_id"
t.index ["author_id", "created_at"], name: "index_todos_on_author_id_and_created_at"
t.index ["author_id"], name: "index_todos_on_author_id"
t.index ["commit_id"], name: "index_todos_on_commit_id"
t.index ["group_id"], name: "index_todos_on_group_id"
......
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