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

Add column name index mapping in PostgresqlRow #640

Closed
wants to merge 1 commit into from

Conversation

cty123
Copy link
Contributor

@cty123 cty123 commented Feb 24, 2024

[resolves #636]

Make sure that:

  • [ x ] You have read the contribution guidelines.
  • [ x ] You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • [ x ] You use the code formatters provided here and have them applied to your changes. Don't submit any formatting related changes.
  • [ x ] You submit test cases (unit or integration tests) that back your changes.

Issue description

Previously getting the fields of the row results requires looping the fields array list to find the field with the specified name, this can be very slow when there's a large amount of columns retrieved. Here I am trying to add a cache to map the column name to index such that we only need to loop the fields list once.

New Public APIs

Additional context

…ooping through the fields unnecessarily.

[resolves pgjdbc#636]
@mp911de mp911de added the type: enhancement A general enhancement label Feb 28, 2024
@mp911de mp911de changed the title perf: add column name index mapping in PostgresqlRow class Add column name index mapping in PostgresqlRow Feb 28, 2024
@mp911de mp911de added this to the 1.0.5.RELEASE milestone Feb 28, 2024
mp911de pushed a commit that referenced this pull request Feb 28, 2024
Avoid looping through the fields unnecessarily.

[resolves #636][#640]
@mp911de mp911de closed this in e8a26c5 Feb 28, 2024
mp911de pushed a commit that referenced this pull request Feb 28, 2024
Avoid looping through the fields unnecessarily.

[resolves #636][#640]
mp911de added a commit that referenced this pull request Feb 28, 2024
Refine hash map initial sizing. Use ROOT locale for field names.

[#636][closes #640]
@mp911de
Copy link
Collaborator

mp911de commented Feb 28, 2024

Thank you for your contribution. That's merged, polished, and backported now.

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

Successfully merging this pull request may close these issues.

Performance issue with PostgresqlRow.getColumn(String name) when select many columns
2 participants