J
J
jslby2015-10-07 11:20:36
PHP
jslby, 2015-10-07 11:20:36

How to optimize work with sqlite3 by combining all queries into one?

There is a script that adds an average of 1000 new records to the table in 5 minutes, while constantly doing it in an INSERT loop. Is it possible to combine all INSERTs into one, thereby reducing the time of working with the table?
It's just that I could prepare the query in a loop, concatenating the rows and then pulling it all at once into SQLite. How is this possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jslby, 2015-10-07
@jslby

Came out with:
$db->query('BEGIN IMMEDIATE TRANSACTION');
...sql query...
$db->query('COMMIT TRANSACTION');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question