mattn / go-oci8

Oracle driver for Go using database/sql
https://mattn.kaoriya.net/
MIT License
630 stars 212 forks source link

I need an example about batch insert operation #277

Closed sunshyer closed 5 years ago

sunshyer commented 5 years ago

I tried to improve insert efficiency , but I can not find the right way about commit/prepare/stmt.exec.

MichaelS11 commented 5 years ago

Added simple insert benchmark/example:

https://github.com/mattn/go-oci8/blob/8fa434520277b7371232d48f23662fd2ec1cad3c/oci8Sql_test.go#L783-L864

There are additional ways to speed up inserts depending on what you are doing. For example, can do a insert from many select dual union all which works well. (Found 50 to 100 works well depending.) Can also use more than one goroutine depending on use case.

cjbj commented 5 years ago

@MichaelS11 you may be interested in https://groups.google.com/forum/#!topic/golang-sql/-J_1aay72nM

MichaelS11 commented 5 years ago

@cjbj Cool, thanks. Something that can be looked into later.

MichaelS11 commented 5 years ago

Close this?

sunshyer commented 5 years ago

Yes, thanks .