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

sql: SHOW FUNCTIONS FROM pg_catalog is slow #94746

Closed
knz opened this issue Jan 5, 2023 · 3 comments · Fixed by #94771
Closed

sql: SHOW FUNCTIONS FROM pg_catalog is slow #94746

knz opened this issue Jan 5, 2023 · 3 comments · Fixed by #94771
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@knz
Copy link
Contributor

knz commented Jan 5, 2023

Describe the problem

See the title.

This may be fallout from #94339? unsure

To Reproduce

cockroach demo then show functions from pg_catalog;

Expected behavior

Lists UDF overloads in pg_catalog schema.

cc @jordanlewis @postamar for triage.

Jira issue: CRDB-23115

@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Jan 5, 2023
@knz
Copy link
Contributor Author

knz commented Jan 5, 2023

Oh I stand corrected, it does terminate eventually, after a full minute of waiting.
There's only 1904 rows. It shouldn't take 1 minute to generate 2k rows.

@jordanlewis
Copy link
Member

SHOW FUNCTIONS currently runs 2 slow projections:

 select pg_get_function_result(oid) from pg_proc;
select pg_catalog.pg_get_function_identity_arguments(oid) from pg_proc;

These weren't edited by my recent PR, but we should definitely do something about this.

@jordanlewis
Copy link
Member

Redefining these as SQL functions speeds them up enormously!

@jordanlewis jordanlewis changed the title sql: SHOW FUNCTIONS FROM pg_catalog never terminates sql: SHOW FUNCTIONS FROM pg_catalog is slow Jan 6, 2023
@craig craig bot closed this as completed in 04762b7 Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
2 participants