[SQLite] Use of db:exec cause 5 second delay
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: [SQLite] Use of db:exec cause 5 second delay
- From: Gilles Ganault <gilles.ganault@...>
- Date: 2014年1月29日 17:41:17 +0100
Hello
I noticed that the "db:exec" part of the following script waits for
about 5s when running on a Linux appliance:
=================
HTTP/1.0 200 OK
Content-Type: text/plain
<?
local db = sqlite3.open('test.db')
-- stalls for about 5s
db:exec[[
CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, content);
INSERT INTO test VALUES (NULL, 'Hello World');
INSERT INTO test VALUES (NULL, 'Hello Lua');
INSERT INTO test VALUES (NULL, 'Hello Sqlite3')
]]
for row in db:nrows("SELECT * FROM test") do
mg.write(row.id, row.content,'\n')
end
mg.write("Done")
db:close()
?>
=================
Why is that, and is there something I could try to speed things up?
Thank you.