CopyFrom appears to slow down in v5 #1410
-
Thank you for this amazingly useful toolkit. I am sure the problem below is user error on my part. I have code that calls CopyFrom with ~600 million rows read from many gob-encoded files on local disk. If I change the pgx version from v4 (e.g. v4.17.2) to v5.1.1, the running time increases from 0.4 hours to 1.8 hours. This is the Values() method:
Source: https://github.com/library-data-platform/ldpmarc/blob/db78cb9dc6069604cc2be1c8ef3a414128212da3/cmd/ldpmarc/local/local.go The data types used are int16, string, and pgtype.UUID. This is running with Go 1.19. Thank you for any help you can offer. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
As far as I know there shouldn't be any significant performance changes in the copy system itself. If I had to guess I would say it is something with the UUIDs. Here's some things to try:
|
Beta Was this translation helpful? Give feedback.
-
Using the pgtype merged into v5 solved the problem. Many thanks! |
Beta Was this translation helpful? Give feedback.
As far as I know there shouldn't be any significant performance changes in the copy system itself. If I had to guess I would say it is something with the UUIDs.
Here's some things to try: