From c11056996b2a6fe5940a4e576d7bcb01a6e40bd9 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jan 12 2023 10:01:24 +0000 Subject: [PATCH 1/2] fix different PG capabilities in schema Related: https://pagure.io/koji/issue/3594 --- diff --git a/docs/schema-upgrade-1.30-1.31.sql b/docs/schema-upgrade-1.30-1.31.sql index 2d311f4..eee9e74 100644 --- a/docs/schema-upgrade-1.30-1.31.sql +++ b/docs/schema-upgrade-1.30-1.31.sql @@ -2,6 +2,16 @@ -- from version 1.30 to 1.31 BEGIN; - -- index for default search method for rpms - CREATE INDEX rpminfo_filename ON rpminfo((name || '-' || version || '-' || release || '.' || arch || '.rpm')) INCLUDE (id); + -- index for default search method for rpms, PG11+ can benefit from new include method + DO $$ + DECLARE version integer; + BEGIN + SELECT current_setting('server_version_num')::integer INTO version; + IF version >= 110000 THEN + EXECUTE 'CREATE INDEX rpminfo_filename ON rpminfo((name || ''-'' || version || ''-'' || release || ''.'' || arch || ''.rpm'')) INCLUDE (id);'; + ELSE + EXECUTE 'CREATE INDEX rpminfo_filename ON rpminfo((name || ''-'' || version || ''-'' || release || ''.'' || arch || ''.rpm''));'; + END IF; + END + $$; COMMIT; diff --git a/docs/schema.sql b/docs/schema.sql index 39b7893..c2ea695 100644 --- a/docs/schema.sql +++ b/docs/schema.sql @@ -734,7 +734,18 @@ CREATE TABLE rpminfo ( CONSTRAINT rpminfo_unique_nvra UNIQUE (name,version,release,arch,external_repo_id) ) WITHOUT OIDS; CREATE INDEX rpminfo_build ON rpminfo(build_id); -CREATE INDEX rpminfo_filename ON rpminfo((name || '-' || version || '-' || release || '.' || arch || '.rpm')) INCLUDE (id); +-- index for default search method for rpms, PG11+ can benefit from new include method +DO $$ + DECLARE version integer; + BEGIN + SELECT current_setting('server_version_num')::integer INTO version; + IF version >= 110000 THEN + EXECUTE 'CREATE INDEX rpminfo_filename ON rpminfo((name || ''-'' || version || ''-'' || release || ''.'' || arch || ''.rpm'')) INCLUDE (id);'; + ELSE + EXECUTE 'CREATE INDEX rpminfo_filename ON rpminfo((name || ''-'' || version || ''-'' || release || ''.'' || arch || ''.rpm''));'; + END IF; + END +$$; -- sighash is the checksum of the signature header CREATE TABLE rpmsigs ( From b18d998df50370edda1a011a3d4acd47428f42b7 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jan 12 2023 10:01:24 +0000 Subject: [PATCH 2/2] update supported platforms --- diff --git a/docs/source/supported_platforms.rst b/docs/source/supported_platforms.rst index af8be78..4622373 100644 --- a/docs/source/supported_platforms.rst +++ b/docs/source/supported_platforms.rst @@ -11,3 +11,9 @@ involves all active Fedoras and RHEL/CentOS 7+. +===========+=====+=====+=========+=======+=====+=====+ | Python | 3.6 | 3.6 | 2.7 | 3.6 | 2.7 | 2.7 | +-----------+-----+-----+---------+-------+-----+-----+ + +For database we're supporting RHEL/CentOS 8+. So, it means that +postgresl 10 is still supported, anyway we encourage using at +least PG 12 (``dnf module enable postgresql:12``). At least some +indices are set up in more efficient way with newer PG +capabilities.