Skip to content

pg_type index implementation#2568

Open
NathanGabrielson wants to merge 2 commits intomainfrom
nathan/pgtypeindex
Open

pg_type index implementation#2568
NathanGabrielson wants to merge 2 commits intomainfrom
nathan/pgtypeindex

Conversation

@NathanGabrielson
Copy link
Copy Markdown
Contributor

@NathanGabrielson NathanGabrielson commented Apr 10, 2026

Adds the two internal indices that should exist on pg_type. Very similar to the existing implementation of pg_class.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

Main PR
covering_index_scan_postgres 1077.40/s 1095.91/s +1.7%
index_join_postgres 158.11/s 157.32/s -0.5%
index_join_scan_postgres 205.64/s 203.68/s -1.0%
index_scan_postgres 12.11/s 12.06/s -0.5%
oltp_point_select 2393.98/s 2378.71/s -0.7%
oltp_read_only 1842.37/s 1825.39/s -1.0%
select_random_points 129.41/s 127.12/s -1.8%
select_random_ranges 825.38/s 827.53/s +0.2%
table_scan_postgres 11.81/s 11.76/s -0.5%
types_table_scan_postgres 5.45/s 5.43/s -0.4%

Comment thread server/tables/pgcatalog/pg_type.go Outdated
Comment thread server/tables/pgcatalog/pg_catalog_cache.go Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Main PR
Total 42090 42090
Successful 17891 17891
Failures 24199 24199
Partial Successes1 5626 5626
Main PR
Successful 42.5065% 42.5065%
Failures 57.4935% 57.4935%

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

Copy link
Copy Markdown
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a couple very minor suggestions.

},
},
{
Name: "join on pg_type using index",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) You may want to add an EXPLAIN SELECT test here, too. Otherwise we aren't testing that this is actually using the index during the join, which I think is what you want to test here.

Comment on lines +33 to +35
PgTypeName = "pg_type"
PgTypeOidIndex = "pg_type_oid_index"
PgTypnameIndex = "pg_type_typname_nsp_index"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) Looks like these are only used in the pgcatalog package, so you could lower case them to avoid exporting them to all packages. Not a huge deal, but always nice to keep things package private if possible and avoid those symbols being available in other packages if they aren't needed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants