lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
8.86k stars 908 forks source link

Improved the performance of CopyIn and CopyInSchema and added BufferQ… #1100

Closed JCPrice0024 closed 1 year ago

JCPrice0024 commented 1 year ago

Wide tables with large column names were slow to call the CopyIn and CopyInSchema functions. Created makeStmt to reduce duplication between the CopyIn and CopyInSchema functions. Created BufferQuoteIdentifier to efficiently generate column names and reduce string allocations. Created BenchmarkCopy which tests only CopyIn's ability to copy large data fast, the results showed that the changed copy ran at 20 ms versus the original which was around 700 ms.