-
Hey. In our application, we scan quite large 2D arrays from the database. We noticed that our application is quite slow, and I made a few benchmarks:
Results:
I'm wondering if there are native ways to improve the scanning of 2D arrays, or if it's better to implement a custom codec for this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Another idea I have is to unnest array - |
Beta Was this translation helpful? Give feedback.
-
Multi-dimensional array scanning into a slice of slices uses a reflection path. As you found, that is much slower. Try using |
Beta Was this translation helpful? Give feedback.
pgtype.Array[float64]
is what you would want to use. You would need look at itsElements
andDims
fields to determine its exact dimensions.