r2dbc-postgresql icon indicating copy to clipboard operation
r2dbc-postgresql copied to clipboard

perf: add column name index mapping in PostgresqlRow class

Open cty123 opened this issue 1 year ago • 0 comments

[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

cty123 avatar Feb 24 '24 20:02 cty123