fix: pg_graphql performance (#3204)

This commit is contained in:
Jérémy M
2024-01-02 16:06:15 +01:00
committed by GitHub
parent 338267b190
commit 2dae94dec6
5 changed files with 106 additions and 60 deletions

View File

@@ -0,0 +1,28 @@
diff --git a/sql/load_sql_context.sql b/sql/load_sql_context.sql
index 565e4e3..40cd99e 100644
--- a/sql/load_sql_context.sql
+++ b/sql/load_sql_context.sql
@@ -95,6 +95,8 @@ select
pg_type pt
left join pg_class tabs
on pt.typrelid = tabs.oid
+ join search_path_oids spo
+ on pt.typnamespace = spo.schema_oid or pt.typnamespace = 'pg_catalog'::regnamespace::oid
),
jsonb_build_object()
),
@@ -111,6 +113,8 @@ select
pg_type pt
join pg_class tabs
on pt.typrelid = tabs.oid
+ join search_path_oids spo
+ on pt.typnamespace = spo.schema_oid or pt.typnamespace = 'pg_catalog'::regnamespace::oid
where
pt.typcategory = 'C'
and tabs.relkind = 'c'
@@ -420,4 +424,4 @@ select
jsonb_build_array()
)
- )
+ );