Create ci_runner_machines_687967fa8a partitioned table

What does this MR do and why?

This MR is the third part of a series of 4 MRs:

Number MR description
1 !168069 (merged) Adds runner_type, sharding_key_id columns to ci_runner_machines
2 !166308 (merged) Uses the new partition_table_by_list method to create the ci_runners_e59bb2812d partitioned table.
3 !168131 (merged) Uses the new partition_table_by_list method to create the ci_runner_machines_687967fa8a partitioned table.
4 TODO Backfills the new ci_runner_machines_687967fa8a table from ci_runner_machines (ignores group/project runner managers that don't have a sharding_key_id).

Changelog: added

Part of #497562 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Migration
$ be rails db:migrate:redo:ci VERSION=20241024204816 RAILS_ENV=test
Running via Spring preloader in process 38286
ci: == [advisory_lock_connection] object_id: 405580, pg_backend_pid: 38293
ci: == 20241024204816 CreatePartitionedCiRunnerManagers: reverting ================
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- execute("DROP TRIGGER IF EXISTS table_sync_trigger_bc3e7b56bd ON ci_runner_machines")
ci:    -> 0.0014s
ci: -- execute("DROP FUNCTION IF EXISTS table_sync_function_e438f29263()")
ci:    -> 0.0009s
ci: -- drop_table("ci_runner_machines_687967fa8a")
ci:    -> 0.0281s
ci: == 20241024204816 CreatePartitionedCiRunnerManagers: reverted (0.1417s) =======

ci: == [advisory_lock_connection] object_id: 405580, pg_backend_pid: 38293
ci: == [advisory_lock_connection] object_id: 407760, pg_backend_pid: 38339
ci: == 20241024204816 CreatePartitionedCiRunnerManagers: migrating ================
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- create_table("ci_runner_machines_687967fa8a", {:primary_key=>["id", "runner_type"], :options=>"PARTITION BY LIST (runner_type)"})
ci: -- quote_column_name(:system_xid)
ci:    -> 0.0000s
ci: -- quote_column_name(:platform)
ci:    -> 0.0000s
ci: -- quote_column_name(:architecture)
ci:    -> 0.0000s
ci: -- quote_column_name(:revision)
ci:    -> 0.0000s
ci: -- quote_column_name(:ip_address)
ci:    -> 0.0000s
ci: -- quote_column_name(:version)
ci:    -> 0.0000s
ci:    -> 0.0340s
ci: -- current_schema(nil)
ci:    -> 0.0013s
ci: -- current_schema(nil)
ci:    -> 0.0009s
ci: -- execute("CREATE TABLE public.instance_type_ci_runner_machines_687967fa8a PARTITION OF ci_runner_machines_687967fa8a\nFOR VALUES IN (1)\n")
ci:    -> 0.0079s
ci: -- current_schema(nil)
ci:    -> 0.0004s
ci: -- current_schema(nil)
ci:    -> 0.0002s
ci: -- execute("CREATE TABLE public.group_type_ci_runner_machines_687967fa8a PARTITION OF ci_runner_machines_687967fa8a\nFOR VALUES IN (2)\n")
ci:    -> 0.0078s
ci: -- current_schema(nil)
ci:    -> 0.0016s
ci: -- current_schema(nil)
ci:    -> 0.0004s
ci: -- execute("CREATE TABLE public.project_type_ci_runner_machines_687967fa8a PARTITION OF ci_runner_machines_687967fa8a\nFOR VALUES IN (3)\n")
ci:    -> 0.0075s
ci: -- execute("CREATE  FUNCTION table_sync_function_e438f29263()\nRETURNS TRIGGER AS\n$$\nBEGIN\nIF (TG_OP = 'DELETE') THEN\n  DELETE FROM ci_runner_machines_687967fa8a where \"id\" = OLD.\"id\";\nELSIF (TG_OP = 'UPDATE') THEN\n  UPDATE ci_runner_machines_687967fa8a\n  SET \"runner_id\" = NEW.\"runner_id\",\n    \"sharding_key_id\" = NEW.\"sharding_key_id\",\n    \"created_at\" = NEW.\"created_at\",\n    \"updated_at\" = NEW.\"updated_at\",\n    \"contacted_at\" = NEW.\"contacted_at\",\n    \"creation_state\" = NEW.\"creation_state\",\n    \"executor_type\" = NEW.\"executor_type\",\n    \"runner_type\" = NEW.\"runner_type\",\n    \"config\" = NEW.\"config\",\n    \"system_xid\" = NEW.\"system_xid\",\n    \"platform\" = NEW.\"platform\",\n    \"architecture\" = NEW.\"architecture\",\n    \"revision\" = NEW.\"revision\",\n    \"ip_address\" = NEW.\"ip_address\",\n    \"version\" = NEW.\"version\"\n  WHERE ci_runner_machines_687967fa8a.\"id\" = NEW.\"id\";\nELSIF (TG_OP = 'INSERT') THEN\n  INSERT INTO ci_runner_machines_687967fa8a (\"id\",\n    \"runner_id\",\n    \"sharding_key_id\",\n    \"created_at\",\n    \"updated_at\",\n    \"contacted_at\",\n    \"creation_state\",\n    \"executor_type\",\n    \"runner_type\",\n    \"config\",\n    \"system_xid\",\n    \"platform\",\n    \"architecture\",\n    \"revision\",\n    \"ip_address\",\n    \"version\")\n  VALUES (NEW.\"id\",\n    NEW.\"runner_id\",\n    NEW.\"sharding_key_id\",\n    NEW.\"created_at\",\n    NEW.\"updated_at\",\n    NEW.\"contacted_at\",\n    NEW.\"creation_state\",\n    NEW.\"executor_type\",\n    NEW.\"runner_type\",\n    NEW.\"config\",\n    NEW.\"system_xid\",\n    NEW.\"platform\",\n    NEW.\"architecture\",\n    NEW.\"revision\",\n    NEW.\"ip_address\",\n    NEW.\"version\");\nEND IF;\nRETURN NULL;\n\nEND\n$$ LANGUAGE PLPGSQL\n")
ci:    -> 0.0049s
ci: -- execute("COMMENT ON FUNCTION table_sync_function_e438f29263 IS 'Partitioning migration: table sync for ci_runner_machines table'")
ci:    -> 0.0019s
ci: -- current_schema(nil)
ci:    -> 0.0008s
ci: -- execute("CREATE TRIGGER table_sync_trigger_bc3e7b56bd\nAFTER INSERT OR UPDATE OR DELETE ON ci_runner_machines\nFOR EACH ROW\n\nEXECUTE FUNCTION table_sync_function_e438f29263()\n")
ci:    -> 0.0016s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- execute("LOCK TABLE ci_runners_e59bb2812d, public.group_type_ci_runner_machines_687967fa8a IN SHARE ROW EXCLUSIVE MODE")
ci:    -> 0.0025s
ci: -- execute("ALTER TABLE public.group_type_ci_runner_machines_687967fa8a ADD CONSTRAINT fk_rails_2f6089e758 FOREIGN KEY (runner_type, runner_id) REFERENCES ci_runners_e59bb2812d (runner_type, id) ON DELETE CASCADE NOT VALID;")
ci:    -> 0.0051s
ci: -- execute("SET statement_timeout TO 0")
ci:    -> 0.0007s
ci: -- execute("ALTER TABLE public.group_type_ci_runner_machines_687967fa8a VALIDATE CONSTRAINT fk_rails_2f6089e758;")
ci:    -> 0.0316s
ci: -- execute("RESET statement_timeout")
ci:    -> 0.0023s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- execute("LOCK TABLE ci_runners_e59bb2812d, public.instance_type_ci_runner_machines_687967fa8a IN SHARE ROW EXCLUSIVE MODE")
ci:    -> 0.0018s
ci: -- execute("ALTER TABLE public.instance_type_ci_runner_machines_687967fa8a ADD CONSTRAINT fk_rails_2f6089e758 FOREIGN KEY (runner_type, runner_id) REFERENCES ci_runners_e59bb2812d (runner_type, id) ON DELETE CASCADE NOT VALID;")
ci:    -> 0.0018s
ci: -- execute("ALTER TABLE public.instance_type_ci_runner_machines_687967fa8a VALIDATE CONSTRAINT fk_rails_2f6089e758;")
ci:    -> 0.0025s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- execute("LOCK TABLE ci_runners_e59bb2812d, public.project_type_ci_runner_machines_687967fa8a IN SHARE ROW EXCLUSIVE MODE")
ci:    -> 0.0008s
ci: -- execute("ALTER TABLE public.project_type_ci_runner_machines_687967fa8a ADD CONSTRAINT fk_rails_2f6089e758 FOREIGN KEY (runner_type, runner_id) REFERENCES ci_runners_e59bb2812d (runner_type, id) ON DELETE CASCADE NOT VALID;")
ci:    -> 0.0017s
ci: -- execute("ALTER TABLE public.project_type_ci_runner_machines_687967fa8a VALIDATE CONSTRAINT fk_rails_2f6089e758;")
ci:    -> 0.0026s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- execute("LOCK TABLE ci_runners_e59bb2812d, ci_runner_machines_687967fa8a IN ACCESS EXCLUSIVE MODE")
ci:    -> 0.0010s
ci: -- execute("ALTER TABLE ci_runner_machines_687967fa8a ADD CONSTRAINT fk_rails_2f6089e758 FOREIGN KEY (runner_type, runner_id) REFERENCES ci_runners_e59bb2812d (runner_type, id) ON DELETE CASCADE ;")
ci:    -> 0.0020s
ci: -- execute("ALTER TABLE ci_runner_machines_687967fa8a VALIDATE CONSTRAINT fk_rails_2f6089e758;")
ci:    -> 0.0009s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- transaction_open?(nil)
ci:    -> 0.0000s
ci: -- execute("ALTER TABLE ci_runner_machines_687967fa8a\nADD CONSTRAINT check_sharding_key_id_nullness\nCHECK ( (runner_type = 1 AND sharding_key_id IS NULL) OR (runner_type <> 1 AND sharding_key_id IS NOT NULL) )\nNOT VALID;\n")
ci:    -> 0.0015s
ci: -- execute("ALTER TABLE ci_runner_machines_687967fa8a VALIDATE CONSTRAINT check_sharding_key_id_nullness;")
ci:    -> 0.0022s
ci: == 20241024204816 CreatePartitionedCiRunnerManagers: migrated (0.4288s) =======

ci: == [advisory_lock_connection] object_id: 407760, pg_backend_pid: 38339
ci_runner_machines_687967fa8a schema
                                        Partitioned table "public.ci_runner_machines_687967fa8a"
+-----------------+--------------------------+-----------+----------+-------------+----------+-------------+--------------+-------------+
|     Column      |           Type           | Collation | Nullable |   Default   | Storage  | Compression | Stats target | Description |
+-----------------+--------------------------+-----------+----------+-------------+----------+-------------+--------------+-------------+
| id              | bigint                   |           | not null |             | plain    |             |              |             |
| runner_id       | bigint                   |           | not null |             | plain    |             |              |             |
| sharding_key_id | bigint                   |           |          |             | plain    |             |              |             |
| created_at      | timestamp with time zone |           | not null |             | plain    |             |              |             |
| updated_at      | timestamp with time zone |           | not null |             | plain    |             |              |             |
| contacted_at    | timestamp with time zone |           |          |             | plain    |             |              |             |
| creation_state  | smallint                 |           | not null | 0           | plain    |             |              |             |
| executor_type   | smallint                 |           |          |             | plain    |             |              |             |
| runner_type     | smallint                 |           | not null |             | plain    |             |              |             |
| config          | jsonb                    |           | not null | '{}'::jsonb | extended |             |              |             |
| system_xid      | text                     |           | not null |             | extended |             |              |             |
| platform        | text                     |           |          |             | extended |             |              |             |
| architecture    | text                     |           |          |             | extended |             |              |             |
| revision        | text                     |           |          |             | extended |             |              |             |
| ip_address      | text                     |           |          |             | extended |             |              |             |
| version         | text                     |           |          |             | extended |             |              |             |
+-----------------+--------------------------+-----------+----------+-------------+----------+-------------+--------------+-------------+
Partition key: LIST (runner_type)
Indexes:
    "ci_runner_machines_687967fa8a_pkey" PRIMARY KEY, btree (id, runner_type)
    "idx_ci_runner_machines_687967fa8a_on_contacted_at_desc_id_desc" btree (contacted_at DESC, id DESC)
    "idx_ci_runner_machines_687967fa8a_on_sharding_key_where_notnull" btree (sharding_key_id) WHERE sharding_key_id IS NOT NULL
    "idx_uniq_ci_runner_machines_687967fa8a_on_runner_id_system_xid" UNIQUE, btree (runner_id, runner_type, system_xid)
    "index_ci_runner_machines_687967fa8a_on_created_at_and_id_desc" btree (created_at, id DESC)
    "index_ci_runner_machines_687967fa8a_on_major_version" btree ("substring"(version, '^\d+\.'::text), version, runner_id)
    "index_ci_runner_machines_687967fa8a_on_minor_version" btree ("substring"(version, '^\d+\.\d+\.'::text), version, runner_id)
    "index_ci_runner_machines_687967fa8a_on_patch_version" btree ("substring"(version, '^\d+\.\d+\.\d+'::text), version, runner_id)
    "index_ci_runner_machines_687967fa8a_on_version" btree (version)
Check constraints:
    "check_3d8736b3af" CHECK (char_length(system_xid) <= 64)
    "check_5bad2a6944" CHECK (char_length(revision) <= 255)
    "check_7dc4eee8a5" CHECK (char_length(version) <= 2048)
    "check_b1e456641b" CHECK (char_length(ip_address) <= 1024)
    "check_c788f4b18a" CHECK (char_length(platform) <= 255)
    "check_f3d25ab844" CHECK (char_length(architecture) <= 255)
Foreign-key constraints:
    "fk_rails_3f92913d27" FOREIGN KEY (runner_id, runner_type) REFERENCES ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
Partitions: group_type_ci_runner_machines_687967fa8a FOR VALUES IN ('2'),
            instance_type_ci_runner_machines_687967fa8a FOR VALUES IN ('1'),
            project_type_ci_runner_machines_687967fa8a FOR VALUES IN ('3')
instance_type_ci_runner_machines_687967fa8a schema
            Table "public.instance_type_ci_runner_machines_687967fa8a"
+-----------------+--------------------------+-----------+----------+-------------+
|     Column      |           Type           | Collation | Nullable |   Default   |
+-----------------+--------------------------+-----------+----------+-------------+
| id              | bigint                   |           | not null |             |
| runner_id       | bigint                   |           | not null |             |
| sharding_key_id | bigint                   |           |          |             |
| created_at      | timestamp with time zone |           | not null |             |
| updated_at      | timestamp with time zone |           | not null |             |
| contacted_at    | timestamp with time zone |           |          |             |
| creation_state  | smallint                 |           | not null | 0           |
| executor_type   | smallint                 |           |          |             |
| runner_type     | smallint                 |           | not null |             |
| config          | jsonb                    |           | not null | '{}'::jsonb |
| system_xid      | text                     |           | not null |             |
| platform        | text                     |           |          |             |
| architecture    | text                     |           |          |             |
| revision        | text                     |           |          |             |
| ip_address      | text                     |           |          |             |
| version         | text                     |           |          |             |
+-----------------+--------------------------+-----------+----------+-------------+
Partition of: ci_runner_machines_687967fa8a FOR VALUES IN ('1')
Indexes:
    "instance_type_ci_runner_machines_687967fa8a_pkey" PRIMARY KEY, btree (id, runner_type)
    "instance_type_ci_runner_machi_runner_id_runner_type_system__idx" UNIQUE, btree (runner_id, runner_type, system_xid)
    "instance_type_ci_runner_machin_substring_version_runner_id_idx1" btree ("substring"(version, '^\d+\.\d+\.'::text), version, runner_id)
    "instance_type_ci_runner_machin_substring_version_runner_id_idx2" btree ("substring"(version, '^\d+\.\d+\.\d+'::text), version, runner_id)
    "instance_type_ci_runner_machine_substring_version_runner_id_idx" btree ("substring"(version, '^\d+\.'::text), version, runner_id)
    "instance_type_ci_runner_machines_687967fa8a_contacted_at_id_idx" btree (contacted_at DESC, id DESC)
    "instance_type_ci_runner_machines_687967fa8a_created_at_id_idx" btree (created_at, id DESC)
    "instance_type_ci_runner_machines_687967fa8a_sharding_key_id_idx" btree (sharding_key_id) WHERE sharding_key_id IS NOT NULL
    "instance_type_ci_runner_machines_687967fa8a_version_idx" btree (version)
Check constraints:
    "check_3d8736b3af" CHECK (char_length(system_xid) <= 64)
    "check_5bad2a6944" CHECK (char_length(revision) <= 255)
    "check_7dc4eee8a5" CHECK (char_length(version) <= 2048)
    "check_b1e456641b" CHECK (char_length(ip_address) <= 1024)
    "check_c788f4b18a" CHECK (char_length(platform) <= 255)
    "check_f3d25ab844" CHECK (char_length(architecture) <= 255)
    "check_sharding_key_id_nullness" CHECK (sharding_key_id IS NULL)
Foreign-key constraints:
    "fk_rails_3f92913d27" FOREIGN KEY (runner_id, runner_type) REFERENCES instance_type_ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ci_runner_machines_687967fa8a" CONSTRAINT "fk_rails_3f92913d27" FOREIGN KEY (runner_id, runner_type) REFERENCES ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
group_type_ci_runner_machines_687967fa8a schema
              Table "public.group_type_ci_runner_machines_687967fa8a"
+-----------------+--------------------------+-----------+----------+-------------+
|     Column      |           Type           | Collation | Nullable |   Default   |
+-----------------+--------------------------+-----------+----------+-------------+
| id              | bigint                   |           | not null |             |
| runner_id       | bigint                   |           | not null |             |
| sharding_key_id | bigint                   |           |          |             |
| created_at      | timestamp with time zone |           | not null |             |
| updated_at      | timestamp with time zone |           | not null |             |
| contacted_at    | timestamp with time zone |           |          |             |
| creation_state  | smallint                 |           | not null | 0           |
| executor_type   | smallint                 |           |          |             |
| runner_type     | smallint                 |           | not null |             |
| config          | jsonb                    |           | not null | '{}'::jsonb |
| system_xid      | text                     |           | not null |             |
| platform        | text                     |           |          |             |
| architecture    | text                     |           |          |             |
| revision        | text                     |           |          |             |
| ip_address      | text                     |           |          |             |
| version         | text                     |           |          |             |
+-----------------+--------------------------+-----------+----------+-------------+
Partition of: ci_runner_machines_687967fa8a FOR VALUES IN ('2')
Indexes:
    "group_type_ci_runner_machines_687967fa8a_pkey" PRIMARY KEY, btree (id, runner_type)
    "group_type_ci_runner_machines_687967fa8a_contacted_at_id_idx" btree (contacted_at DESC, id DESC)
    "group_type_ci_runner_machines_687967fa8a_created_at_id_idx" btree (created_at, id DESC)
    "group_type_ci_runner_machines_687967fa8a_sharding_key_id_idx" btree (sharding_key_id) WHERE sharding_key_id IS NOT NULL
    "group_type_ci_runner_machines_687967fa8a_version_idx" btree (version)
    "group_type_ci_runner_machines_6_substring_version_runner_id_idx" btree ("substring"(version, '^\d+\.'::text), version, runner_id)
    "group_type_ci_runner_machines__substring_version_runner_id_idx1" btree ("substring"(version, '^\d+\.\d+\.'::text), version, runner_id)
    "group_type_ci_runner_machines__substring_version_runner_id_idx2" btree ("substring"(version, '^\d+\.\d+\.\d+'::text), version, runner_id)
    "group_type_ci_runner_machines_runner_id_runner_type_system__idx" UNIQUE, btree (runner_id, runner_type, system_xid)
Check constraints:
    "check_3d8736b3af" CHECK (char_length(system_xid) <= 64)
    "check_5bad2a6944" CHECK (char_length(revision) <= 255)
    "check_7dc4eee8a5" CHECK (char_length(version) <= 2048)
    "check_b1e456641b" CHECK (char_length(ip_address) <= 1024)
    "check_c788f4b18a" CHECK (char_length(platform) <= 255)
    "check_f3d25ab844" CHECK (char_length(architecture) <= 255)
    "check_sharding_key_id_nullness" CHECK (sharding_key_id IS NOT NULL)
Foreign-key constraints:
    "fk_rails_3f92913d27" FOREIGN KEY (runner_id, runner_type) REFERENCES group_type_ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ci_runner_machines_687967fa8a" CONSTRAINT "fk_rails_3f92913d27" FOREIGN KEY (runner_id, runner_type) REFERENCES ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
project_type_ci_runner_machines_687967fa8a schema
             Table "public.project_type_ci_runner_machines_687967fa8a"
+-----------------+--------------------------+-----------+----------+-------------+
|     Column      |           Type           | Collation | Nullable |   Default   |
+-----------------+--------------------------+-----------+----------+-------------+
| id              | bigint                   |           | not null |             |
| runner_id       | bigint                   |           | not null |             |
| sharding_key_id | bigint                   |           |          |             |
| created_at      | timestamp with time zone |           | not null |             |
| updated_at      | timestamp with time zone |           | not null |             |
| contacted_at    | timestamp with time zone |           |          |             |
| creation_state  | smallint                 |           | not null | 0           |
| executor_type   | smallint                 |           |          |             |
| runner_type     | smallint                 |           | not null |             |
| config          | jsonb                    |           | not null | '{}'::jsonb |
| system_xid      | text                     |           | not null |             |
| platform        | text                     |           |          |             |
| architecture    | text                     |           |          |             |
| revision        | text                     |           |          |             |
| ip_address      | text                     |           |          |             |
| version         | text                     |           |          |             |
+-----------------+--------------------------+-----------+----------+-------------+
Partition of: ci_runner_machines_687967fa8a FOR VALUES IN ('3')
Indexes:
    "project_type_ci_runner_machines_687967fa8a_pkey" PRIMARY KEY, btree (id, runner_type)
    "project_type_ci_runner_machin_runner_id_runner_type_system__idx" UNIQUE, btree (runner_id, runner_type, system_xid)
    "project_type_ci_runner_machine_substring_version_runner_id_idx1" btree ("substring"(version, '^\d+\.\d+\.'::text), version, runner_id)
    "project_type_ci_runner_machine_substring_version_runner_id_idx2" btree ("substring"(version, '^\d+\.\d+\.\d+'::text), version, runner_id)
    "project_type_ci_runner_machines_687967fa8a_contacted_at_id_idx" btree (contacted_at DESC, id DESC)
    "project_type_ci_runner_machines_687967fa8a_created_at_id_idx" btree (created_at, id DESC)
    "project_type_ci_runner_machines_687967fa8a_sharding_key_id_idx" btree (sharding_key_id) WHERE sharding_key_id IS NOT NULL
    "project_type_ci_runner_machines_687967fa8a_version_idx" btree (version)
    "project_type_ci_runner_machines_substring_version_runner_id_idx" btree ("substring"(version, '^\d+\.'::text), version, runner_id)
Check constraints:
    "check_3d8736b3af" CHECK (char_length(system_xid) <= 64)
    "check_5bad2a6944" CHECK (char_length(revision) <= 255)
    "check_7dc4eee8a5" CHECK (char_length(version) <= 2048)
    "check_b1e456641b" CHECK (char_length(ip_address) <= 1024)
    "check_c788f4b18a" CHECK (char_length(platform) <= 255)
    "check_f3d25ab844" CHECK (char_length(architecture) <= 255)
    "check_sharding_key_id_nullness" CHECK (sharding_key_id IS NOT NULL)
Foreign-key constraints:
    "fk_rails_3f92913d27" FOREIGN KEY (runner_id, runner_type) REFERENCES project_type_ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ci_runner_machines_687967fa8a" CONSTRAINT "fk_rails_3f92913d27" FOREIGN KEY (runner_id, runner_type) REFERENCES ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
topic screenshot
Comparison between non-partitioned and partitioned tables image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Pedro Pombeiro

Merge request reports

Loading