perf: ignore tables for PgDatabaseMetaData.getTypeInfo #1302
postgres considers tables to be composite types which
New Feature Submissions:
Changes to Existing Features:
The text was updated successfully, but these errors were encountered:
postgres considers tables to be composite types which in very large schemas with lots of tables slows down getTypeInfo. This fix filters out tables from types
we are still having this issue:
Even with this fix, I am getting thousands of results and it causes a significant slowdown when Hibernate is pulling types during initialization. I found this query that is even more targeted (based on this SO post: https://stackoverflow.com/a/16349665/10157442):
With this query, I still get back 201 types, but that's much more reasonable than the 10s of thousands the current query returns for my DB.
@davecramer Ha! That's what I was wondering! I'm new to Postgres and I'm not the DBA. But I can't imagine there are really more than about the 28 or so actual types that Oracle's getTypeInfo returns. Maybe as many as 200, but even that seems a stretch.
I have things like this, which make perfect sense:
But then I also get a bunch of stuff like this:
But most of what I am seeing looks like views and functions and possibly other object types. I also see them repeated with underscore prefixes...I even see tables with underscore prefixes which did not get filtered out.
According to the notes on this fix, the updated query was supposed to filter out tables from the getTypeInfo query, but are other object types still being included? Is everything being repeated with an underscore prefix?
BTW, this is a very large DB, so if all the user defined objects (tables, views, functions, sequences, etc) are being returned as types (twice!), then that explains why I am seeing such a huge result set coming back and a fairly significant delay in my microservices' startup times.
PostgreSQL considers tables to be composite types which in very large schemas with lots of tables slows down getTypeInfo. This fix filters out tables from types