-
Notifications
You must be signed in to change notification settings - Fork 184
Performance issue with PostgresqlRow.getColumn(String name) when select many columns #636
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
Labels
type: enhancement
A general enhancement
Milestone
Comments
This is possible. PGJDBC uses a lazy approach to create the column name to index map, see https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java#L3108-L3136 Happy to merge a pull request. |
cty123
added a commit
to cty123/r2dbc-postgresql
that referenced
this issue
Feb 24, 2024
…ooping through the fields unnecessarily. [resolves pgjdbc#636]
cty123
added a commit
to cty123/r2dbc-postgresql
that referenced
this issue
Mar 3, 2024
cty123
added a commit
to cty123/r2dbc-postgresql
that referenced
this issue
Mar 3, 2024
mp911de
pushed a commit
that referenced
this issue
Mar 4, 2024
mp911de
pushed a commit
that referenced
this issue
Mar 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When selecting many fields, a lot of CPU is consumed because the fields are looped.
In one case I encountered, with a select of millions of records with about 700 fields, I forced the query to stop because it was consuming 100% CPU for several hours.
At this time, I checked Java's stack trace many times, and most of them were processing the following for statement.
r2dbc-postgresql/src/main/java/io/r2dbc/postgresql/PostgresqlRow.java
Lines 168 to 174 in d047276
Would it be possible to prepare field name and order mappings in advance?
The text was updated successfully, but these errors were encountered: