Hello,
I am using SQLite in a Windows environment. The file storing the database is on 
a Windows 2008 server.All other file access to this server is reasonably fast. 
However, when doing simple SELECTS and INSERTS/UPDATESit is noticeably slower 
on a network. I am talking about 50 records.
Now I have read that setting some of the PRAGMAS can improve speed, but at the 
cost of data loss should powerfail or some other hardware condition occur. I am 
willing to risk this if the performance of the SQLite database accesscan be 
increased considerably.
Here is what I am doing in code (This is C#)

string connectionString = ""URI=file:mydb.db; Default Timeout=15; PRAGMA 
busy_timeout = 600"
SQLiteConnection sqConn = new SQLiteConnection(connectionString);sqConn.Open();


Then immediately after opening the database, I'm? running this code

string sqlPragma = "PRAGMA cache_size = 16000; PRAGMA synchronous = OFF; PRAGMA 
journal_mode = MEMORY;";
SQLiteCommand sqlite_command = OMConnection.sqConn.CreateCommand();
sqlite_command.CommandText = sqlPragma;
sqlite_command.ExecuteNonQuery();


This sets up the pragmas for the cache size, synchronous mode, journal mode.

I do not notice any difference in performance with the pragmas vs. without 
them.? Am I doing something wrong?Are there any other documented PRAGMAS which 
might help improve performance or are there any other measuresI can use to get 
faster performance over a network file vs. local file?
ThanksMike

Reply via email to