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

perf: ignore tables for PgDatabaseMetaData.getTypeInfo #1302

Merged
merged 1 commit into from Oct 16, 2018

Conversation

Projects
None yet
4 participants
@davecramer
Copy link
Member

commented Sep 19, 2018

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

fixes #1301

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Does mvn checkstyle:check pass ?

Changes to Existing Features:

  • Does this break existing behaviour? If so please explain.
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?
perf: ignore tables for PgDatabaseMetaData.getTypeInfo
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
@bokken

This comment has been minimized.

Copy link
Member

commented Oct 16, 2018

+1

@davecramer davecramer merged commit e44e4e8 into pgjdbc:master Oct 16, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@davecramer davecramer deleted the davecramer:typecache branch Oct 16, 2018

@camelcamro

This comment has been minimized.

Copy link

commented Mar 20, 2019

we are still having this issue:
should that be fixed on postgres driver version (42.2.5) ?
here the query which was hanging and is blocking the whole database to run the vacuum, and LIVE_TUp are growing up endless ttil the crash.
any fix for it ?
or reopen the ticket ?
cu camel

hanging query:
"SELECT typinput='array_in'::regproc, typtype FROM pg_catalog.pg_type LEFT JOIN (select ns.oid as nspoid, ns.nspname, r.r from pg_namespace as ns join ( select s.r, (current_schemas(false))[s.r] as nspname from generate_series(1, array_upper(current_schemas(false), 1)) as s(r) ) as r using ( nspname ) ) as sp ON sp.nspoid = typnamespace WHERE typname = $1 ORDER BY sp.r, pg_type.oid DESC LIMIT 1"

@davecramer

This comment has been minimized.

Copy link
Member Author

commented Mar 20, 2019

@camelcamro This does not look like the same query causing the original problem in this ticket. Please open a new ticket

Looking at this

sql = "SELECT typinput='array_in'::regproc, typtype "

, it should actually return pretty quickly. How many schemas do you have ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.