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

Poor performance with drivers having slow DatabaseMetaData.getPrimaryKeys impl #77

Closed
kminder opened this issue Jun 26, 2018 · 2 comments

Comments

@kminder
Copy link
Contributor

kminder commented Jun 26, 2018

Performance is rather poor for table output format when two conditions occur for the same result set.

  1. The result set has a large number of columns.
  2. The driver being used has a slow implementation of DatabaseMetaData.getPrimaryKeys.

For example testing has shown that for a query with ~100 columns using the HBase Phoenix thin driver the execution time can be cut from ~30 seconds to ~2 seconds by using CSV output format vs table output format. For example: select * from system.catalog;

This is due to how primary keys are detected. Currently the Rows implementation will make a metadata call for every column to determine it is a primary key for display purposes. I propose optimizing this such that a metadata call is only made for each unique table in the result set's columns.

@kminder
Copy link
Contributor Author

kminder commented Jun 26, 2018

Proposed PR for this here: #78

@julianhyde
Copy link
Owner

Fixed in b14152a, PR #78.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants