Added PRAGMA optimize; constrained columns are killing is. See https://www.sqlite.org/lang_analyze.html
authorKrista Bennett <krista@pep-project.org>
Tue, 20 Feb 2018 10:16:00 +0100
changeset 2526c254f28206de
parent 2525 67f62c556060
child 2527 7b05ea799d96
Added PRAGMA optimize; constrained columns are killing is. See https://www.sqlite.org/lang_analyze.html
src/pEpEngine.c
     1.1 --- a/src/pEpEngine.c	Tue Feb 20 09:58:37 2018 +0100
     1.2 +++ b/src/pEpEngine.c	Tue Feb 20 10:16:00 2018 +0100
     1.3 @@ -1457,9 +1457,17 @@
     1.4                  sqlite3_finalize(session->delete_mistrusted_key);
     1.5              if (session->is_mistrusted_key)
     1.6                  sqlite3_finalize(session->is_mistrusted_key);
     1.7 -        
     1.8 -            if (session->db)
     1.9 +                
    1.10 +            if (session->db) {
    1.11 +                sqlite3_exec(        
    1.12 +                    session->db,
    1.13 +                    "PRAGMA optimize;\n",
    1.14 +                    NULL,
    1.15 +                    NULL,
    1.16 +                    NULL
    1.17 +                );
    1.18                  sqlite3_close_v2(session->db);
    1.19 +            }
    1.20              if (session->system_db)
    1.21                  sqlite3_close_v2(session->system_db);
    1.22          }