Skip to content

Commit

Permalink
Merge #94325
Browse files Browse the repository at this point in the history
94325: sql: improve performance of pg_foo_is_visible r=jordanlewis a=jordanlewis

fixes #93955

Passing in integers to prepared statements that expect oids causes poor performance.

Co-authored-by: rafiss <[email protected]>

Release note: None (no releases with this issue)

Co-authored-by: Jordan Lewis <[email protected]>
  • Loading branch information
craig[bot] and jordanlewis committed Dec 27, 2022
2 parents 0e5acf1 + 090da5b commit 75e145f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/sql/sem/builtins/pg_builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ SELECT description
ctx, "pg_function_is_visible",
sessiondata.NoSessionDataOverride,
"SELECT n.nspname from pg_proc p JOIN pg_namespace n ON p.pronamespace = n.oid WHERE p.oid=$1 LIMIT 1",
oidArg.Oid,
oidArg,
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1267,7 +1267,7 @@ SELECT description
ctx, "pg_table_is_visible",
sessiondata.NoSessionDataOverride,
"SELECT n.nspname from pg_class c INNER LOOKUP JOIN pg_namespace n ON c.relnamespace = n.oid WHERE c.oid=$1 LIMIT 1",
oidArg.Oid,
oidArg,
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1300,7 +1300,7 @@ SELECT description
ctx, "pg_type_is_visible",
sessiondata.NoSessionDataOverride,
"SELECT n.nspname from pg_type t JOIN pg_namespace n ON t.typnamespace = n.oid WHERE t.oid=$1 LIMIT 1",
oidArg.Oid,
oidArg,
)
if err != nil {
return nil, err
Expand Down

0 comments on commit 75e145f

Please sign in to comment.