Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] sql: index pg_catalog.pg_namespace.nspname #70885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajwerner
Copy link
Contributor

This adds a virtual index to enable point lookups against pg_namespace.

This approach is even better than just doing a point lookup, it also leverages
leases. That can run into other consistency problems that we aren't going to
think too hard about right now because there's some issues to fix thim in
this release. It's going to turn N lookups and descriptor constructions into
0.

Release note: None

This adds a virtual index to enable point lookups against pg_namespace.

This approach is even better than just doing a point lookup, it also leverages
leases. That can run into other consistency problems that we aren't going to
think too hard about right now because there's some issues to fix thim in
this release. It's going to turn N lookups and descriptor constructions into
0.

Release note: None
@ajwerner ajwerner requested a review from otan September 29, 2021 21:11
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajwerner
Copy link
Contributor Author

demo@127.0.0.1:26257/movr> SELECT * FROM pg_catalog.pg_namespace WHERE nspname = 'foo';
     oid     | nspname | nspowner  | nspacl
-------------+---------+-----------+---------
  1521659658 | foo     | 978251175 | NULL
(1 row)


Time: 2ms total (execution 2ms / network 0ms)

demo@127.0.0.1:26257/movr> EXPLAIN SELECT * FROM pg_catalog.pg_namespace WHERE nspname = 'foo';
                       info
--------------------------------------------------
  distribution: local
  vectorized: true

  • virtual table
    table: pg_namespace@pg_namespace_nspname_idx
    spans: [/'foo' - /'foo']
(6 rows)



@otan otan removed their request for review October 4, 2021 10:47
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.

None yet

2 participants