On Thu, 10 Sep 2015 18:24:32 +0000 (UTC) Mike McWhinney <eljainc at sbcglobal.net> wrote:
> 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? Try "PRAGMA temp_store = 2;" In one project I use sqlite3 as network db and it is, besides cache_size and page_size, the most important pragma for improve performance. >ThanksMike > _______________________________________________ sqlite-users mailing > list sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users --- --- Eduardo Morras <emorrasg at yahoo.es>

