SQLite Forum

Does the column order in an insert statement impact the insert speed?
Login
In my situation, I have a normal rowid table with 24 columns comprised of 4x INTEGER and 20x TEXT columns (so no BLOBs) with no explicitly defined extra indexes. TEXT columns vary from 10s of characters to a few 100s of characters.

To populate the table, I do inserts for approx 1 million rows (with all columns being populated by a single insert using a prepared statement and transactions  for each block of 10000 rows).

I am trying to tune this, in order to improve the insert speed which is ok for other tables but an order of magnitude slower for this one.

Will the order of the columns in the insert statement have any impact on the insert speed? (Maybe based on how the SQLite code is written it will be faster to have the columns in the same order as they are defined in the table definition?)

What other SQLite suggestions can people give to improve the insert performance so that I can focus on checking these.

Many thanks in advance for your constructive thoughts and ideas.