Add index on pg_publication_rel.prpubid
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 12 Jan 2022 19:23:42 +0000 (16:23 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 12 Jan 2022 19:24:26 +0000 (16:24 -0300)
This should have been added for the benefit of GetPublicationRelations;
let's add it now.

I couldn't measure a performance difference in the TAP tests, but that
may be because the tests use very few publications.

Discussion: https://postgr.es/m/202201120041.p24wvsfcsope@alvherre.pgsql

src/backend/catalog/pg_publication.c
src/include/catalog/catversion.h
src/include/catalog/pg_publication_rel.h

index 2992a2e0c63afc09fd201c34eea14d69e1962c20..cf0700f8ba08bb0603592f116173533526c72537 100644 (file)
@@ -494,7 +494,7 @@ GetPublicationRelations(Oid pubid, PublicationPartOpt pub_partopt)
                                BTEqualStrategyNumber, F_OIDEQ,
                                ObjectIdGetDatum(pubid));
 
-       scan = systable_beginscan(pubrelsrel, PublicationRelPrrelidPrpubidIndexId,
+       scan = systable_beginscan(pubrelsrel, PublicationRelPrpubidIndexId,
                                                          true, NULL, 1, &scankey);
 
        result = NIL;
index 23cc4b48aac41098268a75b465d08703c9532b94..fc904bcb9be09332731a9d22b5a54dd0a90bd88e 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     202112131
+#define CATALOG_VERSION_NO     202201121
 
 #endif
index 0ff37162258d3ec5f80a91f96de7db2c99f30337..117a1d67e56d8a74edb9a33a4bc8f788e3190526 100644 (file)
@@ -42,5 +42,6 @@ typedef FormData_pg_publication_rel *Form_pg_publication_rel;
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_publication_rel_oid_index, 6112, PublicationRelObjectIndexId, on pg_publication_rel using btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_publication_rel_prrelid_prpubid_index, 6113, PublicationRelPrrelidPrpubidIndexId, on pg_publication_rel using btree(prrelid oid_ops, prpubid oid_ops));
+DECLARE_INDEX(pg_publication_rel_prpubid_index, 6116, PublicationRelPrpubidIndexId, on pg_publication_rel using btree(prpubid oid_ops));
 
 #endif                                                 /* PG_PUBLICATION_REL_H */