From 5c78c31e3ec080d6be0e2b7e9782f2979668bc72 Mon Sep 17 00:00:00 2001 From: moaz-khalifa Date: Thu, 11 Dec 2025 18:42:45 +0100 Subject: [PATCH 1/2] Create remote cache entries table for Maven virtual registry - Introduced a new table `virtual_registries_packages_maven_cache_remote_entries` to replace the existing `virtual_registries_packages_maven_cache_entries` after changing the partitioning strategy - Add a model class for the new table with a minimal setup Changelog: added EE: true --- config/gitlab_loose_foreign_keys.yml | 6 + ...es_packages_maven_cache_remote_entries.yml | 13 + ...ies_packages_maven_cache_remote_entries.rb | 68 ++ ...packages_maven_cache_remote_entries_iid.rb | 16 + db/schema_migrations/20251211135944 | 1 + db/schema_migrations/20251212154259 | 1 + db/structure.sql | 866 ++++++++++++++++++ .../packages/maven/cache/remote.rb | 15 + .../packages/maven/cache/remote/entry.rb | 27 + .../packages/maven/cache/remote/entries.rb | 36 + .../packages/maven/cache/remote/entry_spec.rb | 33 + 11 files changed, 1082 insertions(+) create mode 100644 db/docs/virtual_registries_packages_maven_cache_remote_entries.yml create mode 100644 db/migrate/20251211135944_create_virtual_registries_packages_maven_cache_remote_entries.rb create mode 100644 db/migrate/20251212154259_create_sequence_on_virtual_registries_packages_maven_cache_remote_entries_iid.rb create mode 100644 db/schema_migrations/20251211135944 create mode 100644 db/schema_migrations/20251212154259 create mode 100644 ee/app/models/virtual_registries/packages/maven/cache/remote.rb create mode 100644 ee/app/models/virtual_registries/packages/maven/cache/remote/entry.rb create mode 100644 ee/spec/factories/virtual_registries/packages/maven/cache/remote/entries.rb create mode 100644 ee/spec/models/virtual_registries/packages/maven/cache/remote/entry_spec.rb diff --git a/config/gitlab_loose_foreign_keys.yml b/config/gitlab_loose_foreign_keys.yml index 1a5156a97c448f..5310a9dd0b791d 100644 --- a/config/gitlab_loose_foreign_keys.yml +++ b/config/gitlab_loose_foreign_keys.yml @@ -925,6 +925,12 @@ virtual_registries_packages_maven_cache_entries: on_delete: update_column_to target_column: status target_value: 2 +virtual_registries_packages_maven_cache_remote_entries: + - table: virtual_registries_packages_maven_upstreams + column: upstream_id + on_delete: update_column_to + target_column: status + target_value: 2 vulnerabilities: - table: users column: dismissed_by_id diff --git a/db/docs/virtual_registries_packages_maven_cache_remote_entries.yml b/db/docs/virtual_registries_packages_maven_cache_remote_entries.yml new file mode 100644 index 00000000000000..2405f088d8369f --- /dev/null +++ b/db/docs/virtual_registries_packages_maven_cache_remote_entries.yml @@ -0,0 +1,13 @@ +--- +table_name: virtual_registries_packages_maven_cache_remote_entries +classes: + - VirtualRegistries::Packages::Maven::Cache::Remote::Entry +feature_categories: + - virtual_registry +description: Remote cache entry for the Maven virtual packages registry. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/216172 +milestone: '18.7' +gitlab_schema: gitlab_main_org +sharding_key: + group_id: namespaces +table_size: small diff --git a/db/migrate/20251211135944_create_virtual_registries_packages_maven_cache_remote_entries.rb b/db/migrate/20251211135944_create_virtual_registries_packages_maven_cache_remote_entries.rb new file mode 100644 index 00000000000000..b001ea46f8efe1 --- /dev/null +++ b/db/migrate/20251211135944_create_virtual_registries_packages_maven_cache_remote_entries.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +class CreateVirtualRegistriesPackagesMavenCacheRemoteEntries < Gitlab::Database::Migration[2.3] + include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers + + disable_ddl_transaction! + milestone '18.7' + + TABLE_NAME = :virtual_registries_packages_maven_cache_remote_entries + + def up + create_table TABLE_NAME, if_not_exists: true, options: 'PARTITION BY HASH (group_id)', + primary_key: %i[group_id iid] do |t| + t.bigint :iid, null: false + t.references :group, + null: false, + index: false, # already indexed by the primary key + foreign_key: { to_table: :namespaces } + t.bigint :upstream_id, null: false + t.bigint :downloads_count, default: 0, null: false + + t.timestamps_with_timezone null: false + t.datetime_with_timezone :upstream_checked_at, null: false, default: -> { 'NOW()' } + t.datetime_with_timezone :downloaded_at, null: false, default: -> { 'NOW()' } + + t.integer :size, null: false + t.integer :file_store, limit: 2, default: 1, null: false + t.integer :status, limit: 2, default: 0, null: false + + t.binary :file_sha1, null: false + t.binary :file_md5 + + t.text :relative_path, null: false, limit: 1024 + t.text :object_storage_key, null: false, limit: 1024 + t.text :upstream_etag, limit: 255 + t.text :content_type, limit: 255, null: false, default: 'application/octet-stream' + t.text :file, null: false, limit: 1024 + + t.index %i[relative_path object_storage_key group_id], + unique: true, + name: :idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key + + t.index %i[upstream_id relative_path group_id], + unique: true, + where: 'status = 0', + name: :idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path + + # for text search on relative path + t.index :relative_path, + using: :gin, + opclass: :gin_trgm_ops, + name: :idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram + + # for LFK update query when upstream is deleted + t.index %i[upstream_id status], + name: :idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status + + t.check_constraint '(file_md5 IS NULL OR octet_length(file_md5) = 16)' + t.check_constraint '(octet_length(file_sha1) = 20)' + end + + create_hash_partitions(TABLE_NAME, 16) + end + + def down + drop_table TABLE_NAME, if_exists: true + end +end diff --git a/db/migrate/20251212154259_create_sequence_on_virtual_registries_packages_maven_cache_remote_entries_iid.rb b/db/migrate/20251212154259_create_sequence_on_virtual_registries_packages_maven_cache_remote_entries_iid.rb new file mode 100644 index 00000000000000..ad2a091edad560 --- /dev/null +++ b/db/migrate/20251212154259_create_sequence_on_virtual_registries_packages_maven_cache_remote_entries_iid.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateSequenceOnVirtualRegistriesPackagesMavenCacheRemoteEntriesIid < Gitlab::Database::Migration[2.3] + milestone '18.7' + + TABLE_NAME = :virtual_registries_packages_maven_cache_remote_entries + SEQUENCE_NAME = :virtual_registries_packages_maven_cache_remote_entries_iid_seq + + def up + add_sequence(TABLE_NAME, :iid, SEQUENCE_NAME, 1) + end + + def down + drop_sequence(TABLE_NAME, :iid, SEQUENCE_NAME) + end +end diff --git a/db/schema_migrations/20251211135944 b/db/schema_migrations/20251211135944 new file mode 100644 index 00000000000000..b2af804644a913 --- /dev/null +++ b/db/schema_migrations/20251211135944 @@ -0,0 +1 @@ +0919b7c0847d2a498b73974581b0f336ba249e0c427f2faca9567a7052d78299 \ No newline at end of file diff --git a/db/schema_migrations/20251212154259 b/db/schema_migrations/20251212154259 new file mode 100644 index 00000000000000..e74d0276ceabca --- /dev/null +++ b/db/schema_migrations/20251212154259 @@ -0,0 +1 @@ +e24f7e9f5940eab077aaadb61f66862e2ad10a2f93f9947802fe9862dc4bc4cc \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 48de31cf4594ee..5332ca5f954b16 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9555,6 +9555,490 @@ CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_en CONSTRAINT check_fd9fc90696 CHECK ((char_length(upstream_etag) <= 255)) ); +CREATE SEQUENCE virtual_registries_packages_maven_cache_remote_entries_iid_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +CREATE TABLE virtual_registries_packages_maven_cache_remote_entries ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +) +PARTITION BY HASH (group_id); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + +CREATE TABLE gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 ( + iid bigint DEFAULT nextval('virtual_registries_packages_maven_cache_remote_entries_iid_seq'::regclass) NOT NULL, + group_id bigint NOT NULL, + upstream_id bigint NOT NULL, + downloads_count bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL, + downloaded_at timestamp with time zone DEFAULT now() NOT NULL, + size integer NOT NULL, + file_store smallint DEFAULT 1 NOT NULL, + status smallint DEFAULT 0 NOT NULL, + file_sha1 bytea NOT NULL, + file_md5 bytea, + relative_path text NOT NULL, + object_storage_key text NOT NULL, + upstream_etag text, + content_type text DEFAULT 'application/octet-stream'::text NOT NULL, + file text NOT NULL, + CONSTRAINT check_3b002d9c70 CHECK ((char_length(relative_path) <= 1024)), + CONSTRAINT check_3c247dc29d CHECK ((char_length(file) <= 1024)), + CONSTRAINT check_8d84955388 CHECK ((char_length(upstream_etag) <= 255)), + CONSTRAINT check_f699e9ea8b CHECK ((char_length(object_storage_key) <= 1024)), + CONSTRAINT check_fa0d05ab4f CHECK ((char_length(content_type) <= 255)), + CONSTRAINT chk_rails_176c0ec5da CHECK ((octet_length(file_sha1) = 20)), + CONSTRAINT chk_rails_f9a2aeef13 CHECK (((file_md5 IS NULL) OR (octet_length(file_md5) = 16))) +); + CREATE TABLE work_item_descriptions ( work_item_id bigint NOT NULL, namespace_id bigint NOT NULL, @@ -31574,6 +32058,38 @@ ALTER TABLE ONLY virtual_registries_packages_maven_cache_entries ATTACH PARTITIO ALTER TABLE ONLY virtual_registries_packages_maven_cache_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_entries_15 FOR VALUES WITH (modulus 16, remainder 15); +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 FOR VALUES WITH (modulus 16, remainder 0); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 FOR VALUES WITH (modulus 16, remainder 1); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 FOR VALUES WITH (modulus 16, remainder 2); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 FOR VALUES WITH (modulus 16, remainder 3); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 FOR VALUES WITH (modulus 16, remainder 4); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 FOR VALUES WITH (modulus 16, remainder 5); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 FOR VALUES WITH (modulus 16, remainder 6); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 FOR VALUES WITH (modulus 16, remainder 7); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 FOR VALUES WITH (modulus 16, remainder 8); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 FOR VALUES WITH (modulus 16, remainder 9); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 FOR VALUES WITH (modulus 16, remainder 10); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 FOR VALUES WITH (modulus 16, remainder 11); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 FOR VALUES WITH (modulus 16, remainder 12); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 FOR VALUES WITH (modulus 16, remainder 13); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 FOR VALUES WITH (modulus 16, remainder 14); + +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 FOR VALUES WITH (modulus 16, remainder 15); + ALTER TABLE ONLY work_item_descriptions ATTACH PARTITION gitlab_partitions_static.work_item_descriptions_00 FOR VALUES WITH (modulus 64, remainder 0); ALTER TABLE ONLY work_item_descriptions ATTACH PARTITION gitlab_partitions_static.work_item_descriptions_01 FOR VALUES WITH (modulus 64, remainder 1); @@ -34113,6 +34629,57 @@ ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cach ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_entries_15 ADD CONSTRAINT virtual_registries_packages_maven_cache_entries_15_pkey PRIMARY KEY (upstream_id, relative_path, status); +ALTER TABLE ONLY virtual_registries_packages_maven_cache_remote_entries + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_00_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_01_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_02_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_03_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_04_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_05_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_06_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_07_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_08_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_09_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_10_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_11_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_12_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_13_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_14_pkey PRIMARY KEY (group_id, iid); + +ALTER TABLE ONLY gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 + ADD CONSTRAINT virtual_registries_packages_maven_cache_remote_entries_15_pkey PRIMARY KEY (group_id, iid); + ALTER TABLE ONLY work_item_descriptions ADD CONSTRAINT work_item_descriptions_pkey PRIMARY KEY (work_item_id, namespace_id); @@ -38710,6 +39277,74 @@ CREATE INDEX virtual_registries_container_cache_entries_14_relative_path_idx ON CREATE INDEX virtual_registries_container_cache_entries_15_relative_path_idx ON gitlab_partitions_static.virtual_registries_container_cache_entries_15 USING gin (relative_path gin_trgm_ops); +CREATE UNIQUE INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ON ONLY virtual_registries_packages_maven_cache_remote_entries USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages__relative_path_object_storage_idx10 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages__relative_path_object_storage_idx11 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages__relative_path_object_storage_idx12 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages__relative_path_object_storage_idx13 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages__relative_path_object_storage_idx14 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages__relative_path_object_storage_idx15 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ON ONLY virtual_registries_packages_maven_cache_remote_entries USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx10 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx11 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx12 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx13 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx14 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx15 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage__idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx1 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx2 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx3 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx4 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx5 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx6 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx7 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx8 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx9 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 USING btree (relative_path, object_storage_key, group_id); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx1 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx2 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx3 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx4 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx5 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx6 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx7 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx8 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx9 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gro_idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); + CREATE INDEX idx_vregs_pkgs_mvn_cache_entries_on_pending_upt_id_relpath ON ONLY virtual_registries_packages_maven_cache_entries USING btree (upstream_id, relative_path) WHERE (status = 2); CREATE INDEX virtual_registries_packages_mav_upstream_id_relative_path_idx10 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_entries_10 USING btree (upstream_id, relative_path) WHERE (status = 2); @@ -38776,6 +39411,22 @@ CREATE INDEX virtual_registries_packages_maven_c_upstream_id_created_at_idx9 ON CREATE INDEX virtual_registries_packages_maven_ca_upstream_id_created_at_idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_entries_00 USING btree (upstream_id, created_at) WHERE (status = 0); +CREATE INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ON ONLY virtual_registries_packages_maven_cache_remote_entries USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cach_upstream_id_status_idx10 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cach_upstream_id_status_idx11 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cach_upstream_id_status_idx12 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cach_upstream_id_status_idx13 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cach_upstream_id_status_idx14 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cach_upstream_id_status_idx15 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache__upstream_id_status_idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 USING btree (upstream_id, status); + CREATE INDEX idx_vreg_pkgs_maven_cache_entries_on_group_id_status ON ONLY virtual_registries_packages_maven_cache_entries USING btree (group_id, status); CREATE INDEX virtual_registries_packages_maven_cache_e_group_id_status_idx10 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_entries_10 USING btree (group_id, status); @@ -38844,6 +39495,58 @@ CREATE INDEX virtual_registries_packages_maven_cache_entr_relative_path_idx9 ON CREATE INDEX virtual_registries_packages_maven_cache_entri_relative_path_idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_entries_00 USING gin (relative_path gin_trgm_ops); +CREATE INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ON ONLY virtual_registries_packages_maven_cache_remote_entries USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_rem_relative_path_idx10 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_rem_relative_path_idx11 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_rem_relative_path_idx12 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_rem_relative_path_idx13 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_rem_relative_path_idx14 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_rem_relative_path_idx15 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx1 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx2 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx3 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx4 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx5 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx6 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx7 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx8 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remo_relative_path_idx9 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_remot_relative_path_idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 USING gin (relative_path gin_trgm_ops); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx1 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx2 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx3 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx4 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx5 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx6 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx7 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx8 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 USING btree (upstream_id, status); + +CREATE INDEX virtual_registries_packages_maven_cache_upstream_id_status_idx9 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 USING btree (upstream_id, status); + CREATE INDEX virtual_registries_packages_maven_upstream_id_relative_path_idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_entries_00 USING btree (upstream_id, relative_path) WHERE (status = 2); CREATE INDEX index_work_item_descriptions_on_last_edited_by_id ON ONLY work_item_descriptions USING btree (last_edited_by_id) WHERE (last_edited_by_id IS NOT NULL); @@ -47606,6 +48309,70 @@ ALTER INDEX virtual_registries_container_cache_entries_pkey ATTACH PARTITION git ALTER INDEX idx_vregs_container_cache_entries_on_relative_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_container_cache_entries_15_relative_path_idx; +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__relative_path_object_storage_idx10; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__relative_path_object_storage_idx11; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__relative_path_object_storage_idx12; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__relative_path_object_storage_idx13; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__relative_path_object_storage_idx14; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__relative_path_object_storage_idx15; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx10; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx11; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx12; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx13; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx14; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx15; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage__idx; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx1; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx2; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx3; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx4; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx5; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx6; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx7; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx8; + +ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx9; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx1; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx2; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx3; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx4; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx5; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx6; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx7; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx8; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx9; + +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gro_idx; + ALTER INDEX idx_vregs_pkgs_mvn_cache_entries_on_pending_upt_id_relpath ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_mav_upstream_id_relative_path_idx10; ALTER INDEX idx_vregs_pkgs_mvn_cache_entries_on_pending_upt_id_relpath ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_mav_upstream_id_relative_path_idx11; @@ -47668,6 +48435,20 @@ ALTER INDEX idx_vregs_pkgs_mvn_cache_entries_on_pending_upt_id_created_at ATTACH ALTER INDEX idx_vregs_pkgs_mvn_cache_entries_on_pending_upt_id_created_at ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_ca_upstream_id_created_at_idx; +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cach_upstream_id_status_idx10; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cach_upstream_id_status_idx11; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cach_upstream_id_status_idx12; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cach_upstream_id_status_idx13; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cach_upstream_id_status_idx14; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cach_upstream_id_status_idx15; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache__upstream_id_status_idx; + ALTER INDEX idx_vreg_pkgs_maven_cache_entries_on_group_id_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_e_group_id_status_idx10; ALTER INDEX idx_vreg_pkgs_maven_cache_entries_on_group_id_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_e_group_id_status_idx11; @@ -47764,6 +48545,88 @@ ALTER INDEX virtual_registries_packages_maven_cache_entries_pkey ATTACH PARTITIO ALTER INDEX virtual_registries_packages_maven_cache_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_entries_15_pkey; +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_rem_relative_path_idx10; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_rem_relative_path_idx11; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_rem_relative_path_idx12; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_rem_relative_path_idx13; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_rem_relative_path_idx14; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_rem_relative_path_idx15; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx1; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx2; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx3; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx4; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx5; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx6; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx7; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx8; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remo_relative_path_idx9; + +ALTER INDEX idx_vregs_pkgs_maven_cache_remote_entries_on_rel_path_trigram ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remot_relative_path_idx; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14_pkey; + +ALTER INDEX virtual_registries_packages_maven_cache_remote_entries_pkey ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15_pkey; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx1; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx2; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx3; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx4; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx5; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx6; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx7; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx8; + +ALTER INDEX idx_vreg_pkgs_mvn_cache_remote_entries_upstream_id_and_status ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_cache_upstream_id_status_idx9; + ALTER INDEX idx_vregs_pkgs_mvn_cache_entries_on_pending_upt_id_relpath ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_maven_upstream_id_relative_path_idx; ALTER INDEX index_work_item_descriptions_on_last_edited_by_id ATTACH PARTITION gitlab_partitions_static.work_item_descriptions_00_last_edited_by_id_idx; @@ -54097,6 +54960,9 @@ ALTER TABLE ONLY user_saved_views ALTER TABLE ONLY alert_management_alert_user_mentions ADD CONSTRAINT fk_rails_eb2de0cdef FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; +ALTER TABLE virtual_registries_packages_maven_cache_remote_entries + ADD CONSTRAINT fk_rails_eba99c81d3 FOREIGN KEY (group_id) REFERENCES namespaces(id); + ALTER TABLE ONLY snippet_statistics ADD CONSTRAINT fk_rails_ebc283ccf1 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE; diff --git a/ee/app/models/virtual_registries/packages/maven/cache/remote.rb b/ee/app/models/virtual_registries/packages/maven/cache/remote.rb new file mode 100644 index 00000000000000..14cf5663be9cb4 --- /dev/null +++ b/ee/app/models/virtual_registries/packages/maven/cache/remote.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module VirtualRegistries + module Packages + module Maven + module Cache + module Remote + def self.table_name_prefix + 'virtual_registries_packages_maven_cache_remote_' + end + end + end + end + end +end diff --git a/ee/app/models/virtual_registries/packages/maven/cache/remote/entry.rb b/ee/app/models/virtual_registries/packages/maven/cache/remote/entry.rb new file mode 100644 index 00000000000000..0230cc4adde343 --- /dev/null +++ b/ee/app/models/virtual_registries/packages/maven/cache/remote/entry.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module VirtualRegistries + module Packages + module Maven + module Cache + module Remote + class Entry < ApplicationRecord + include ShaAttribute + + self.primary_key = %i[group_id iid] + + belongs_to :group, optional: false + belongs_to :upstream, class_name: 'VirtualRegistries::Packages::Maven::Upstream', optional: false + + validates :group, top_level_group: true + + enum :status, default: 0, processing: 1, pending_destruction: 2, error: 3 + + sha_attribute :file_sha1 + sha_attribute :file_md5 + end + end + end + end + end +end diff --git a/ee/spec/factories/virtual_registries/packages/maven/cache/remote/entries.rb b/ee/spec/factories/virtual_registries/packages/maven/cache/remote/entries.rb new file mode 100644 index 00000000000000..ee0bd69ab11663 --- /dev/null +++ b/ee/spec/factories/virtual_registries/packages/maven/cache/remote/entries.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :virtual_registries_packages_maven_cache_remote_entry, + class: 'VirtualRegistries::Packages::Maven::Cache::Remote::Entry' do + upstream { association :virtual_registries_packages_maven_upstream } + group { upstream.group } + sequence(:relative_path) { |n| "/a/relative/path/test-#{n}.txt" } + size { 1.kilobyte } + upstream_etag { OpenSSL::Digest.hexdigest('SHA256', 'test') } + content_type { 'text/plain' } + file_md5 { 'd8e8fca2dc0f896fd7cb4cb0031ba249' } + file_sha1 { '4e1243bd22c66e76c2ba9eddc1f91394e57f9f83' } + status { :default } + object_storage_key { "virtual_registries/packages/maven/#{group.path}/remote/#{relative_path}" } + + transient do + file_fixture { 'spec/fixtures/bfg_object_map.txt' } + end + + after(:build) do |entry, evaluator| + entry.upstream.registry_upstreams.each { |registry_upstream| registry_upstream.group = entry.group } + entry.file = fixture_file_upload(evaluator.file_fixture) + end + + trait :upstream_checked do + upstream_checked_at { 30.minutes.ago } + upstream_etag { 'test' } + end + + trait :with_download_metrics do + downloads_count { 15 } + downloaded_at { 30.minutes.ago } + end + end +end diff --git a/ee/spec/models/virtual_registries/packages/maven/cache/remote/entry_spec.rb b/ee/spec/models/virtual_registries/packages/maven/cache/remote/entry_spec.rb new file mode 100644 index 00000000000000..c9e3a42f9ea7e9 --- /dev/null +++ b/ee/spec/models/virtual_registries/packages/maven/cache/remote/entry_spec.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe VirtualRegistries::Packages::Maven::Cache::Remote::Entry, :aggregate_failures, feature_category: :virtual_registry do + describe 'associations' do + it { is_expected.to belong_to(:group).required } + it { is_expected.to belong_to(:upstream).required } + end + + it_behaves_like 'having unique enum values' + + describe 'validations' do + context 'with a non top-level group' do + let(:subgroup) { build(:group, parent: build(:group)) } + let(:entry) { build(:virtual_registries_packages_maven_cache_remote_entry, group: subgroup) } + + it 'is invalid' do + expect(entry).to be_invalid + expect(entry.errors[:group]).to include('must be a top level Group') + end + end + end + + context 'with loose foreign key on virtual_registries_container_cache_remote_entries.upstream_id' do + it_behaves_like 'update by a loose foreign key' do + let_it_be(:parent) { create(:virtual_registries_packages_maven_upstream) } + let_it_be(:model) { create(:virtual_registries_packages_maven_cache_remote_entry, upstream: parent) } + + let(:find_model) { described_class.take } + end + end +end -- GitLab From 70fd64101fdbecf1af88cc384e4c82332777a750 Mon Sep 17 00:00:00 2001 From: Moaz Khalifa Date: Tue, 16 Dec 2025 14:08:11 +0100 Subject: [PATCH 2/2] Bump milestone to 18.8 --- ...es_packages_maven_cache_remote_entries.yml | 2 +- ...ies_packages_maven_cache_remote_entries.rb | 5 +- ...packages_maven_cache_remote_entries_iid.rb | 2 +- db/structure.sql | 66 +++++++++---------- 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/db/docs/virtual_registries_packages_maven_cache_remote_entries.yml b/db/docs/virtual_registries_packages_maven_cache_remote_entries.yml index 2405f088d8369f..ae9e9419de3773 100644 --- a/db/docs/virtual_registries_packages_maven_cache_remote_entries.yml +++ b/db/docs/virtual_registries_packages_maven_cache_remote_entries.yml @@ -6,7 +6,7 @@ feature_categories: - virtual_registry description: Remote cache entry for the Maven virtual packages registry. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/216172 -milestone: '18.7' +milestone: '18.8' gitlab_schema: gitlab_main_org sharding_key: group_id: namespaces diff --git a/db/migrate/20251211135944_create_virtual_registries_packages_maven_cache_remote_entries.rb b/db/migrate/20251211135944_create_virtual_registries_packages_maven_cache_remote_entries.rb index b001ea46f8efe1..687b4d8de6e5cd 100644 --- a/db/migrate/20251211135944_create_virtual_registries_packages_maven_cache_remote_entries.rb +++ b/db/migrate/20251211135944_create_virtual_registries_packages_maven_cache_remote_entries.rb @@ -4,7 +4,7 @@ class CreateVirtualRegistriesPackagesMavenCacheRemoteEntries < Gitlab::Database: include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers disable_ddl_transaction! - milestone '18.7' + milestone '18.8' TABLE_NAME = :virtual_registries_packages_maven_cache_remote_entries @@ -40,9 +40,10 @@ def up unique: true, name: :idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key - t.index %i[upstream_id relative_path group_id], + t.index %i[upstream_id group_id relative_path], unique: true, where: 'status = 0', + include: :iid, name: :idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path # for text search on relative path diff --git a/db/migrate/20251212154259_create_sequence_on_virtual_registries_packages_maven_cache_remote_entries_iid.rb b/db/migrate/20251212154259_create_sequence_on_virtual_registries_packages_maven_cache_remote_entries_iid.rb index ad2a091edad560..d714af239194b1 100644 --- a/db/migrate/20251212154259_create_sequence_on_virtual_registries_packages_maven_cache_remote_entries_iid.rb +++ b/db/migrate/20251212154259_create_sequence_on_virtual_registries_packages_maven_cache_remote_entries_iid.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class CreateSequenceOnVirtualRegistriesPackagesMavenCacheRemoteEntriesIid < Gitlab::Database::Migration[2.3] - milestone '18.7' + milestone '18.8' TABLE_NAME = :virtual_registries_packages_maven_cache_remote_entries SEQUENCE_NAME = :virtual_registries_packages_maven_cache_remote_entries_iid_seq diff --git a/db/structure.sql b/db/structure.sql index 5332ca5f954b16..d0ddf56efb93dd 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -39291,19 +39291,19 @@ CREATE UNIQUE INDEX virtual_registries_packages__relative_path_object_storage_id CREATE UNIQUE INDEX virtual_registries_packages__relative_path_object_storage_idx15 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 USING btree (relative_path, object_storage_key, group_id); -CREATE UNIQUE INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ON ONLY virtual_registries_packages_maven_cache_remote_entries USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ON ONLY virtual_registries_packages_maven_cache_remote_entries USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx10 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_group_id_relativ_idx10 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_10 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx11 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_group_id_relativ_idx11 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_11 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx12 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_group_id_relativ_idx12 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_12 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx13 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_group_id_relativ_idx13 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_13 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx14 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_group_id_relativ_idx14 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_14 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_relative_path_gr_idx15 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages__upstream_id_group_id_relativ_idx15 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_15 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage__idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 USING btree (relative_path, object_storage_key, group_id); @@ -39325,25 +39325,25 @@ CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_i CREATE UNIQUE INDEX virtual_registries_packages_m_relative_path_object_storage_idx9 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 USING btree (relative_path, object_storage_key, group_id); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx1 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx1 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_01 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx2 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx2 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_02 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx3 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx3 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_03 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx4 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx4 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_04 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx5 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx5 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_05 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx6 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx6 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_06 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx7 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx7 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_07 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx8 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx8 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_08 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gr_idx9 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relativ_idx9 ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_09 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); -CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_relative_path_gro_idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 USING btree (upstream_id, relative_path, group_id) WHERE (status = 0); +CREATE UNIQUE INDEX virtual_registries_packages_m_upstream_id_group_id_relative_idx ON gitlab_partitions_static.virtual_registries_packages_maven_cache_remote_entries_00 USING btree (upstream_id, group_id, relative_path) INCLUDE (iid) WHERE (status = 0); CREATE INDEX idx_vregs_pkgs_mvn_cache_entries_on_pending_upt_id_relpath ON ONLY virtual_registries_packages_maven_cache_entries USING btree (upstream_id, relative_path) WHERE (status = 2); @@ -48321,17 +48321,17 @@ ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTA ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__relative_path_object_storage_idx15; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx10; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_group_id_relativ_idx10; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx11; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_group_id_relativ_idx11; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx12; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_group_id_relativ_idx12; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx13; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_group_id_relativ_idx13; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx14; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_group_id_relativ_idx14; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_relative_path_gr_idx15; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages__upstream_id_group_id_relativ_idx15; ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage__idx; @@ -48353,25 +48353,25 @@ ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTA ALTER INDEX idx_uniq_vreg_pkgs_mvn_cache_remote_entries_on_rel_path_and_key ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_relative_path_object_storage_idx9; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx1; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx1; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx2; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx2; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx3; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx3; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx4; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx4; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx5; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx5; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx6; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx6; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx7; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx7; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx8; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx8; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gr_idx9; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relativ_idx9; -ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_relative_path_gro_idx; +ALTER INDEX idx_uniq_vreg_mvn_cache_remote_entries_on_upstream_id_rel_path ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_m_upstream_id_group_id_relative_idx; ALTER INDEX idx_vregs_pkgs_mvn_cache_entries_on_pending_upt_id_relpath ATTACH PARTITION gitlab_partitions_static.virtual_registries_packages_mav_upstream_id_relative_path_idx10; -- GitLab