Currently, executeMany is simply a call to replicateM execute. This could be optimised.
I've done work on this in this branch:
The main changes are:
1. SqlDoubles, SqlInt32s and SqlInt64s are given to postgres in binary form.
2. Some arrays that are used for this are reused in executeMany, so it gets a little faster than mapM_ execute.
3. There is a new benchmarking executable (buildable with -fbuildbenchmarks) that benchmarks mapM_ execute vs. executeMany.
4. There are new quickcheck properties, mainly for testing readFromDB . writeToDB == id.
5. Somewhat unrelated to executeMany: I switched to hexadecimal format for giving and retrieving bytestrings to and from postgres. This fixes one (at least perceived) bug that the quickcheck properties exposed: Now you can write and read any SqlByteString to postgres as a bytea without dealing with escaping or en-/decoding. Feedback on this is very welcome.
readFromDB . writeToDB == id