tds icon indicating copy to clipboard operation
tds copied to clipboard

Batch Insert/ Batch Select

Open neokrishna opened this issue 6 years ago • 2 comments

Hi , Thanks for creating the only go lib for Sybase. Just wanted to check if we have the feature of doing batch select and batch insert . For Ex in Java I can control the fetch size while doing select which can return million records: DataSource iq; Connection iqConnection = iq.getConnection(); PreparedStatement stmnt = iqConnection.prepareStatement(selectQuery); stmnt.setFetchDirection(ResultSet.FETCH_FORWARD); stmnt.setFetchSize(batchSize); // 10000 ResultSet result = stmnt.executeQuery()

Similarly for doing batch insert.

Is this something which is already present(I couldn't find it) or is it something in your road map?

Many Thanks

neokrishna avatar Jan 14 '20 22:01 neokrishna

Hi,

The fetch size does not provide such a huge performance improvement in my experience.

However batching the inserts does indeed. I need to provide an API for this a sgo's database/sql interface does not.

Ideally I should also parse simple insert statements and convert them to bulk inserts. However it requires reverse engeneering the bulk insert serialization method and parsing the sql statements so it's quite harder than just batching.

I'll work on simple inserts batching and will try to deliver this semester. Good bulk insert support however is a bit time consuming for me so I would need help.

thda avatar Jan 18 '20 07:01 thda

Please see this issue on the golang repo for tracking

thda avatar Jul 02 '20 06:07 thda