Skip to content
代码片段 群组 项目
提交 51c32f4d 编辑于 作者: Alex Pooley's avatar Alex Pooley 提交者: Adam Hegyi
浏览文件

Partial index optimization for namespaces id

上级 e609f959
No related branches found
No related tags found
无相关合并请求
---
title: Partial index optimization for namespaces id
merge_request: 58220
author:
type: performance
# frozen_string_literal: true
class CreateNamespacesIdParentIdPartialIndex < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
NAME = 'index_namespaces_id_parent_id_is_null'
disable_ddl_transaction!
def up
add_concurrent_index :namespaces, :id, where: 'parent_id IS NULL', name: NAME
end
def down
remove_concurrent_index :namespaces, :id, name: NAME
end
end
d29f002f88440a10674b251791fa027cb0ae1c1b0c4fd776a2078e3c94160f17
\ No newline at end of file
......@@ -23160,6 +23160,8 @@ CREATE UNIQUE INDEX index_namespace_root_storage_statistics_on_namespace_id ON n
 
CREATE UNIQUE INDEX index_namespace_statistics_on_namespace_id ON namespace_statistics USING btree (namespace_id);
 
CREATE INDEX index_namespaces_id_parent_id_is_null ON namespaces USING btree (id) WHERE (parent_id IS NULL);
CREATE INDEX index_namespaces_on_created_at ON namespaces USING btree (created_at);
 
CREATE INDEX index_namespaces_on_custom_project_templates_group_id_and_type ON namespaces USING btree (custom_project_templates_group_id, type) WHERE (custom_project_templates_group_id IS NOT NULL);
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册