You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to map a third-party postres 9.5 database with more than 22000 (yes, twenty-two thousands) tables.
My goal is to fetch some data in my Go application.
Obviously I am interested in a couple of tables, the command line I am using is this:
Unfortunately the command never finishes processing.
So I debugged the application and found that the query that is taking forever is at dizzyfool/genna/lib/store.go@180
In particular, the offending subquery is
select distinct
kcu.table_schema as table_schema,
kcu.table_name as table_name,
kcu.column_name as column_name,
array_agg((
select constraint_type::text
from information_schema.table_constraints tc
where tc.constraint_name = kcu.constraint_name
and tc.constraint_schema = kcu.constraint_schema
and tc.constraint_catalog = kcu.constraint_catalog
limit 1
)) as constraint_types
from information_schema.key_column_usage kcu
group by kcu.table_schema, kcu.table_name, kcu.column_name
If I execute this statement on my database, this query never finishes
If I add a where condition with table names filter, it is very slow but it completes.
What do you think about this change?
The text was updated successfully, but these errors were encountered:
Hello, I am trying to map a third-party postres 9.5 database with more than 22000 (yes, twenty-two thousands) tables.
My goal is to fetch some data in my Go application.
Obviously I am interested in a couple of tables, the command line I am using is this:
Unfortunately the command never finishes processing.
So I debugged the application and found that the query that is taking forever is at dizzyfool/genna/lib/store.go@180
In particular, the offending subquery is
If I execute this statement on my database, this query never finishes
If I add a where condition with table names filter, it is very slow but it completes.
What do you think about this change?
The text was updated successfully, but these errors were encountered: