Skip to content

Commit 025b920

Browse files
committed
Add index on pg_publication_rel.prpubid
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
1 parent 134d974 commit 025b920

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/backend/catalog/pg_publication.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ GetPublicationRelations(Oid pubid, PublicationPartOpt pub_partopt)
494494
BTEqualStrategyNumber, F_OIDEQ,
495495
ObjectIdGetDatum(pubid));
496496

497-
scan = systable_beginscan(pubrelsrel, PublicationRelPrrelidPrpubidIndexId,
497+
scan = systable_beginscan(pubrelsrel, PublicationRelPrpubidIndexId,
498498
true, NULL, 1, &scankey);
499499

500500
result = NIL;

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 202112131
56+
#define CATALOG_VERSION_NO 202201121
5757

5858
#endif

src/include/catalog/pg_publication_rel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ typedef FormData_pg_publication_rel *Form_pg_publication_rel;
4242

4343
DECLARE_UNIQUE_INDEX_PKEY(pg_publication_rel_oid_index, 6112, PublicationRelObjectIndexId, on pg_publication_rel using btree(oid oid_ops));
4444
DECLARE_UNIQUE_INDEX(pg_publication_rel_prrelid_prpubid_index, 6113, PublicationRelPrrelidPrpubidIndexId, on pg_publication_rel using btree(prrelid oid_ops, prpubid oid_ops));
45+
DECLARE_INDEX(pg_publication_rel_prpubid_index, 6116, PublicationRelPrpubidIndexId, on pg_publication_rel using btree(prpubid oid_ops));
4546

4647
#endif /* PG_PUBLICATION_REL_H */

0 commit comments

Comments
 (0)